Class: HammerCLIForemanRemoteExecution::JobInvocation

Inherits:
HammerCLIForeman::Command
  • Object
show all
Defined in:
lib/hammer_cli_foreman_remote_execution/job_invocation.rb

Defined Under Namespace

Classes: CreateCommand, InfoCommand, ListCommand, OutputCommand

Class Method Summary collapse

Class Method Details

.extend_data(invocation) ⇒ Object



138
139
140
141
142
143
144
145
146
147
148
149
# File 'lib/hammer_cli_foreman_remote_execution/job_invocation.rb', line 138

def self.extend_data(invocation)
  if invocation['targeting'] && invocation['targeting']['hosts']
    invocation['hosts'] = "\n" + invocation['targeting']['hosts'].map { |host| " - #{host['name']}" }.join("\n")
  end

  if invocation['recurrence']
    invocation['cron_line'] = invocation['recurrence']['cron_line']
    invocation['recurring_logic_id'] = invocation['recurrence']['id']
  end

  invocation
end