app/lib/actions/katello/repository/update.rb in katello-3.16.0.rc2 vs app/lib/actions/katello/repository/update.rb in katello-3.16.0.rc2.1
- old
+ new
@@ -8,10 +8,12 @@
def plan(root, repo_params)
repository = root.library_instance
action_subject root.library_instance
repo_params[:url] = nil if repo_params[:url] == ''
+ update_cv_cert_protected = (repo_params[:unprotected] != repository.unprotected)
+
root.update!(repo_params)
if root.download_policy == ::Runcible::Models::YumImporter::DOWNLOAD_BACKGROUND
::Foreman::Deprecation.api_deprecation_warning("Background download_policy will be removed in Katello 4.0. Any background repositories will be converted to Immediate")
end
@@ -42,16 +44,25 @@
if root.pulp_update_needed?
plan_pulp_action([::Actions::Pulp::Orchestration::Repository::Refresh,
::Actions::Pulp3::Orchestration::Repository::Update],
repository,
SmartProxy.pulp_master)
- plan_self(:repository_id => root.library_instance.id)
+ plan_self(:repository_id => root.library_instance.id, :update_cv_cert_protected => update_cv_cert_protected)
end
end
def run
repository = ::Katello::Repository.find(input[:repository_id])
+ output[:repository_id] = input[:repository_id]
+ output[:update_cv_cert_protected] = input[:update_cv_cert_protected]
ForemanTasks.async_task(Katello::Repository::MetadataGenerate, repository)
+ end
+
+ def finalize
+ repository = ::Katello::Repository.find(output[:repository_id])
+ if output[:update_cv_cert_protected]
+ ForemanTasks.async_task(::Actions::Katello::Repository::UpdateCVRepoCertGuard, repository, SmartProxy.pulp_master)
+ end
end
private
def update_content?(repository)