class HammerCLIForemanRemoteExecution::JobInvocation

Public Class Methods

extend_data(invocation) click to toggle source
# File lib/hammer_cli_foreman_remote_execution/job_invocation.rb, line 187
def self.extend_data(invocation)
  if (targeting = invocation['targeting']) && invocation['targeting']['hosts']
    invocation['randomized_ordering'] = targeting['randomized_ordering']
    if (hosts = targeting['hosts'])
      invocation['hosts'] = "\n" + hosts.map { |host| " - #{host['name']}" }.join("\n")
    end
  end

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

  invocation
end