From ccd234acfa7c7294f036d3904b01ca74aed9a985 Mon Sep 17 00:00:00 2001 From: Jeremy Lenz Date: Fri, 16 Jun 2023 10:58:01 -0400 Subject: [PATCH] Fixes #36504 - use assign_single_environment in bulk action (#10615) --- app/lib/actions/katello/host/update_content_view.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/lib/actions/katello/host/update_content_view.rb b/app/lib/actions/katello/host/update_content_view.rb index 60d64d826d6..e119a9ac3e6 100644 --- a/app/lib/actions/katello/host/update_content_view.rb +++ b/app/lib/actions/katello/host/update_content_view.rb @@ -4,8 +4,10 @@ module Host class UpdateContentView < Actions::EntryAction def plan(host, content_view_id, lifecycle_environment_id) if host.content_facet - host.content_facet.content_view = ::Katello::ContentView.find(content_view_id) - host.content_facet.lifecycle_environment = ::Katello::KTEnvironment.find(lifecycle_environment_id) + host.content_facet.assign_single_environment( + content_view_id: content_view_id, + lifecycle_environment_id: lifecycle_environment_id + ) host.update_candlepin_associations plan_self(:hostname => host.name) else