Class: Actions::Katello::Host::UploadProfiles

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

Instance Method Summary collapse

Instance Method Details

#humanized_nameObject



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

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

#plan(host, profile_string) ⇒ Object



11
12
13
14
15
16
17
# File 'app/lib/actions/katello/host/upload_profiles.rb', line 11

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



7
8
9
# File 'app/lib/actions/katello/host/upload_profiles.rb', line 7

def queue
  ::Katello::HOST_TASKS_QUEUE
end

#rescue_strategyObject



31
32
33
# File 'app/lib/actions/katello/host/upload_profiles.rb', line 31

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

#resource_locksObject



27
28
29
# File 'app/lib/actions/katello/host/upload_profiles.rb', line 27

def resource_locks
  :link
end

#runObject



35
36
37
38
39
40
41
42
43
# File 'app/lib/actions/katello/host/upload_profiles.rb', line 35

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