app/lib/actions/katello/host/update.rb in katello-3.3.2 vs app/lib/actions/katello/host/update.rb in katello-3.4.0.rc1

- old
+ new

@@ -10,15 +10,15 @@ sequence do host.content_facet.save! if host.content_facet if host.subscription_facet - if consumer_params - host.subscription_facet.update_from_consumer_attributes(consumer_params) - else + unless consumer_params consumer_params = host.subscription_facet.consumer_attributes end + + host.subscription_facet.update_from_consumer_attributes(consumer_params) host.subscription_facet.save! plan_action(::Actions::Candlepin::Consumer::Update, host.subscription_facet.uuid, consumer_params) end if host.subscription_facet.try(:autoheal) @@ -26,13 +26,15 @@ end end end def run - host = ::Host.find(input[:host_id]) - unless input[:facts].blank? - ::Katello::Host::SubscriptionFacet.update_facts(host, input[:facts]) - input[:facts] = 'TRIMMED' + User.as_anonymous_admin do + host = ::Host.find(input[:host_id]) + unless input[:facts].blank? + ::Katello::Host::SubscriptionFacet.update_facts(host, input[:facts]) + input[:facts] = 'TRIMMED' + end end end def resource_locks :update