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