Class: Actions::Katello::Host::UploadPackageProfile

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

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



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

def humanized_name
  if input.try(:[], :hostname)
    _("Package Profile Update for %s") % input[:hostname]
  else
    _('Package Profile Update')
  end
end

#plan(host, profile_string) ⇒ Object



9
10
11
12
13
14
15
# File 'app/lib/actions/katello/host/upload_package_profile.rb', line 9

def plan(host, profile_string)
  action_subject host

  sequence do
    plan_self(:host_id => host.id, :hostname => host.name, :profile_string => profile_string)
  end
end

#queueObject



5
6
7
# File 'app/lib/actions/katello/host/upload_package_profile.rb', line 5

def queue
  ::Katello::HOST_TASKS_QUEUE
end

#rescue_strategyObject



29
30
31
# File 'app/lib/actions/katello/host/upload_package_profile.rb', line 29

def rescue_strategy
  Dynflow::Action::Rescue::Skip
end

#resource_locksObject



25
26
27
# File 'app/lib/actions/katello/host/upload_package_profile.rb', line 25

def resource_locks
  :link
end

#runObject



33
34
35
36
37
38
39
40
41
# File 'app/lib/actions/katello/host/upload_package_profile.rb', line 33

def run
  host = ::Host.find_by(:id => input[:host_id])
  uploader = ::Katello::Host::PackageProfileUploader.new(
    host: host,
    profile_string: input[:profile_string]
  )
  uploader.upload
  uploader.trigger_applicability_generation
end