app/lib/actions/katello/repository/update.rb in katello-4.13.1 vs app/lib/actions/katello/repository/update.rb in katello-4.14.0.rc1
- old
+ new
@@ -90,11 +90,11 @@
def handle_acs_product_removal(repository)
# Remove products from ACS's that contain no repositories which both
# match the ACS content type and have a non-nil URL
product = repository.product
repo_content_types = Set.new
- product.repositories.each do |test_repo|
+ product.acs_compatible_repositories.each do |test_repo|
# we need to check id because test_repo will still contain the old, non-nil url
repo_content_types.add(test_repo.content_type) if (repository.id != test_repo.id) && test_repo.url.present?
end
::Katello::AlternateContentSource.with_products(product).each do |acs|
unless repo_content_types.include?(acs.content_type)
@@ -108,14 +108,14 @@
def update_content?(repository)
repository.library_instance? && !repository.product.redhat?
end
def create_acs?(old_url, new_url)
- old_url.nil? && new_url.present?
+ (old_url.nil? || old_url.start_with?('uln')) && new_url.present? && !new_url.start_with?('uln')
end
def delete_acs?(old_url, new_url)
- old_url.present? && new_url.nil?
+ old_url.present? && (new_url.nil? || new_url.start_with?('uln'))
end
end
end
end
end