Class: Actions::Katello::Host::UpdateContentView

Inherits:
EntryAction
  • Object
show all
Defined in:
app/lib/actions/katello/host/update_content_view.rb

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



18
19
20
21
22
23
24
# File 'app/lib/actions/katello/host/update_content_view.rb', line 18

def humanized_name
  if input.try(:[], :hostname).nil?
    _("Update for host")
  else
    _("Update for host %s") % input[:hostname]
  end
end

#plan(host, content_view_id, lifecycle_environment_id) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/lib/actions/katello/host/update_content_view.rb', line 5

def plan(host, content_view_id, lifecycle_environment_id)
  if host.content_facet
    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
    fail _("Host %s has not been registered with subscription-manager.") % host.name
  end
end