Class: Chimp::ExecArray

Inherits:
Executor show all
Defined in:
lib/right_chimp/exec/exec_array.rb

Constant Summary

Constants inherited from Executor

Chimp::Executor::STATUS_DONE, Chimp::Executor::STATUS_ERROR, Chimp::Executor::STATUS_HOLDING, Chimp::Executor::STATUS_NONE, Chimp::Executor::STATUS_RETRYING, Chimp::Executor::STATUS_RUNNING

Instance Attribute Summary

Attributes inherited from Executor

#array, #concurrency, #delay, #dry_run, #error, #exec, #group, #inputs, #job_id, #job_notes, #job_uuid, #owner, #quiet, #results, #retry_count, #retry_sleep, #server, #status, #template, #time_end, #time_start, #timeout, #verbose

Instance Method Summary collapse

Methods inherited from Executor

#cancel, #get_total_exec_time, #initialize, #queue, #requeue

Constructor Details

This class inherits a constructor from Chimp::Executor

Instance Method Details

#describe_workObject



27
28
29
# File 'lib/right_chimp/exec/exec_array.rb', line 27

def describe_work
  "ExecArray job_id=#{@job_id} script=\"#{@exec['right_script']['name']}\" server=\"#{@server['nickname']}\""
end

#infoObject



31
32
33
# File 'lib/right_chimp/exec/exec_array.rb', line 31

def info
  @exec['right_script']['name']
end

#runObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/right_chimp/exec/exec_array.rb', line 6

def run
  run_with_retry do
    options = @inputs

    if @timeout < 300
      Log.error 'timeout was less than 5 minutes! resetting to 5 minutes'
      @timeout = 300
    end

    audit_entry = @array.run_script_on_instances(@exec, @server['href'], options)

    if audit_entry
      audit_entry.each do |a|
        a.wait_for_completed('no audit link available', @timeout)
      end
    else
      Log.warn "No audit entries returned for job_id=#{@job_id}"
    end
  end
end

#targetObject



35
36
37
# File 'lib/right_chimp/exec/exec_array.rb', line 35

def target
  @server['nickname']
end