Class: HammerCLIForemanRemoteExecution::JobInvocation

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

Defined Under Namespace

Modules: WithoutNameOption Classes: CancelCommand, CreateCommand, InfoCommand, ListCommand, OutputCommand, RerunCommand

Class Method Summary collapse

Class Method Details

.extend_data(invocation) ⇒ Object



186
187
188
189
190
191
192
193
194
195
196
197
# File 'lib/hammer_cli_foreman_remote_execution/job_invocation.rb', line 186

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