app/services/katello/pulp3/repository/yum.rb in katello-4.14.1 vs app/services/katello/pulp3/repository/yum.rb in katello-4.15.0.rc1
- old
+ new
@@ -18,12 +18,12 @@
end
options.merge!(url: uri.to_s) if uri
options.merge!(policy: root.download_policy)
end
- def publication_options(repository_version)
- options = super(repository_version)
+ def publication_options(repository)
+ options = super(repository)
# To work around https://projects.theforeman.org/issues/37715
checksum_type = if root.checksum_type.nil?
'sha256'
else
root.checksum_type
@@ -48,11 +48,11 @@
def distribution_options(path)
{
base_path: path,
publication: repo.publication_href,
- name: "#{generate_backend_object_name}"
+ name: "#{generate_backend_object_name}",
}
end
def import_distribution_data
distribution = ::Katello::Pulp3::Distribution.fetch_content_list(repository_version: repo.version_href)
@@ -139,11 +139,11 @@
data_dup.config = []
data.config.each do |repo_config|
config_hash = {
source_repo_version: repo_config[:source_repo_version],
dest_repo: repo_config[:dest_repo],
- content: []
+ content: [],
}
config_hash[:dest_base_version] = repo_config[:dest_base_version] if repo_config[:dest_base_version]
data_dup.config << config_hash
end
data_dup
@@ -251,11 +251,11 @@
filters.each do |filter|
if filter.inclusion
source_repo_ids.each do |repo_id|
filter_list_map[:whitelist_ids] += filter.content_unit_pulp_ids(::Katello::Repository.find(repo_id))
end
- elsif filter.class == ContentViewErratumFilter
+ elsif filter.instance_of?(ContentViewErratumFilter)
source_repo_ids.each do |repo_id|
filter_list_map[:blacklist_ids] += filter.content_unit_pulp_ids(::Katello::Repository.find(repo_id), additional_included_errata)
end
else
source_repo_ids.each do |repo_id|
@@ -278,11 +278,11 @@
def add_modular_content(source_repo_ids, filters, modular_filters, filter_list_map)
inclusion_modular_filters = modular_filters.select { |filter| filter.inclusion }
exclusion_modular_filters = modular_filters - inclusion_modular_filters
if inclusion_modular_filters.empty? &&
- !(filters.any? { |filter| filter.class == ContentViewErratumFilter && filter.inclusion })
+ !(filters.any? { |filter| filter.instance_of?(ContentViewErratumFilter) && filter.inclusion })
source_repo_ids.each do |source_repo_id|
source_repo = ::Katello::Repository.find(source_repo_id)
filter_list_map[:whitelist_ids] += source_repo.rpms.where(:modular => true).pluck(:pulp_id).sort
filter_list_map[:whitelist_ids] += source_repo.module_streams.pluck(:pulp_id).sort
end
@@ -399,10 +399,10 @@
end
(errata_filters + package_filters).each do |filter|
if filter.inclusion
whitelist_ids += filter.content_unit_pulp_ids(source_repository)
- elsif filter.class == ContentViewErratumFilter
+ elsif filter.instance_of?(ContentViewErratumFilter)
blacklist_ids += filter.content_unit_pulp_ids(source_repository, additional_included_errata)
else
blacklist_ids += filter.content_unit_pulp_ids(source_repository)
end
end