Class: Actions::Katello::Host::Package::Update
- Inherits:
-
AgentAction
- Object
- EntryAction
- AgentAction
- Actions::Katello::Host::Package::Update
show all
- Defined in:
- app/lib/actions/katello/host/package/update.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from AgentAction
#accept_timeout, #dispatch_history, #dispatch_message, #fail_on_errors, #finish_timeout, #plan, #presenter, #process_timeout, #rescue_strategy, #run
#presenter
Class Method Details
.agent_message ⇒ Object
6
7
8
|
# File 'app/lib/actions/katello/host/package/update.rb', line 6
def self.agent_message
:update_package
end
|
Instance Method Details
#agent_action_type ⇒ Object
10
11
12
|
# File 'app/lib/actions/katello/host/package/update.rb', line 10
def agent_action_type
:content_install
end
|
31
32
33
34
35
36
37
|
# File 'app/lib/actions/katello/host/package/update.rb', line 31
def
if input[:content].present?
(_("Update of package(s) requested: %{packages}") % {packages: input[:content].join(", ")}).truncate(255)
else
_("Update of all packages requested")
end
end
|
#finalize ⇒ Object
26
27
28
29
|
# File 'app/lib/actions/katello/host/package/update.rb', line 26
def finalize
host = ::Host.find_by(:id => input[:host_id])
host.update(audit_comment: )
end
|
22
23
24
|
# File 'app/lib/actions/katello/host/package/update.rb', line 22
def humanized_input
[(input[:content].present? && input[:content].join(", ") || "all packages")] + super
end
|
#humanized_name ⇒ Object
14
15
16
17
18
19
20
|
# File 'app/lib/actions/katello/host/package/update.rb', line 14
def humanized_name
if input.try(:[], :hostname)
_("Update package for %s") % input[:hostname]
else
_("Update package")
end
end
|