Class: Chimp::ExecArray

Inherits:
Executor show all
Defined in:
lib/right_chimp/exec/ExecArray.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, #dry_run, #error, #exec, #group, #inputs, #job_id, #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



28
29
30
# File 'lib/right_chimp/exec/ExecArray.rb', line 28

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

#infoObject



32
33
34
# File 'lib/right_chimp/exec/ExecArray.rb', line 32

def info
  return @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
26
# File 'lib/right_chimp/exec/ExecArray.rb', line 6

def run
  run_with_retry do
    audit_entry = []
    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



36
37
38
# File 'lib/right_chimp/exec/ExecArray.rb', line 36

def target
  return @server['nickname']
end