From c1bed5b3859128995eaf79a434b38a8bbf72dd75 Mon Sep 17 00:00:00 2001 From: Partha Aji Date: Tue, 11 Jul 2023 16:23:09 -0400 Subject: [PATCH] Fixes #36540 - Accurately checks custom product enablement upgrade task PR for Issue #36120 changed behavior of custom repos. By default all custom repos got disabled in candlepin. However a migration task was provided to add overrides for existing custom repos. This commit checks if there are any custom product content who's enablement is set to true. This implies that upgrade rake task update_custom_products_enablement has not run and hence the task can be run. --- .../tasks/upgrades/4.9/update_custom_products_enablement.rake | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/katello/tasks/upgrades/4.9/update_custom_products_enablement.rake b/lib/katello/tasks/upgrades/4.9/update_custom_products_enablement.rake index cc00fd2fe8d..18383940935 100644 --- a/lib/katello/tasks/upgrades/4.9/update_custom_products_enablement.rake +++ b/lib/katello/tasks/upgrades/4.9/update_custom_products_enablement.rake @@ -3,6 +3,7 @@ namespace :katello do namespace '4.9' do desc "Update custom products enablement" task :update_custom_products_enablement => ['environment'] do + next unless ::Katello::ProductContent.custom.where(enabled: true).exists? migrator = Katello::Util::DefaultEnablementMigrator.new migrator.execute! end