app/services/katello/pulp3/repository/yum.rb in katello-3.15.3.1 vs app/services/katello/pulp3/repository/yum.rb in katello-3.16.0.rc1

- old
+ new

@@ -18,32 +18,46 @@ publication: repo.publication_href, name: "#{generate_backend_object_name}" } end + def mirror_remote_options + policy = smart_proxy.download_policy + + if smart_proxy.download_policy == SmartProxy::DOWNLOAD_INHERIT + policy = repo.root.download_policy + end + + { policy: policy } + end + def import_distribution_data distribution = ::Katello::Pulp3::Distribution.fetch_content_list(repository_version: repo.version_href) if distribution.results.present? - repo.update_attributes!( + repo.update!( :distribution_version => distribution.results.first.release_version, :distribution_arch => distribution.results.first.arch, :distribution_family => distribution.results.first.release_name, :distribution_uuid => distribution.results.first.pulp_href, :distribution_bootable => self.class.distribution_bootable?(distribution) ) unless distribution.results.first.variants.empty? unless distribution.results.first.variants.first.name.nil? - repo.update_attributes!(:distribution_variant => distribution.results.first.variants.first.name) + repo.update!(:distribution_variant => distribution.results.first.variants.first.name) end end end end def self.distribution_bootable?(distribution) file_paths = distribution.results.first.images.map(&:path) file_paths.any? do |path| path.include?('vmlinuz') || path.include?('pxeboot') || path.include?('kernel.img') || path.include?('initrd.img') || path.include?('boot.iso') end + end + + def partial_repo_path + "/pulp/repos/#{repo.relative_path}/".sub('//', '/') end def copy_content_for_source # TODO fail NotImplementedError