Class: Chimp::ExecRightScript

Inherits:
Executor
  • Object
show all
Defined in:
lib/right_chimp/exec/ExecRightScript.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



22
23
24
# File 'lib/right_chimp/exec/ExecRightScript.rb', line 22

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

#infoObject



26
27
28
# File 'lib/right_chimp/exec/ExecRightScript.rb', line 26

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

#runObject



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/right_chimp/exec/ExecRightScript.rb', line 7

def run
  options = {:ignore_lock => true}.merge(@inputs)
  
  if @timeout < 300
    Log.error "timeout was less than 5 minutes! resetting to 5 minutes"
    @timeout = 300
  end

  run_with_retry do
    audit_entry = server.run_executable(@exec, options)
    audit_entry.wait_for_state("completed", @timeout)
    @results = audit_entry.summary
  end
end

#targetObject



30
31
32
# File 'lib/right_chimp/exec/ExecRightScript.rb', line 30

def target
  return @server['nickname']
end