class Chimp::ExecRightScript

Class that describes the execution for a rightscript

Attributes

audit_entry_data[RW]
audit_entry_url[RW]

Public Instance Methods

describe_work() click to toggle source
# File lib/right_chimp/exec/exec_rightscript.rb, line 28
def describe_work
  "[#{@job_uuid}] ExecRightScript job_id=#{@job_id} script=\"#{@exec.params['right_script']['name']}\" server=\"#{@server.nickname}\""
end
info() click to toggle source
# File lib/right_chimp/exec/exec_rightscript.rb, line 32
def info
  @exec.params['right_script']['name']
end
run() click to toggle source
# File lib/right_chimp/exec/exec_rightscript.rb, line 9
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
    task = Task.new
    task.tasker = @server.run_executable(@exec, options)
    @audit_entry_url = task.friendly_url
    task.wait_for_state('completed', @timeout)

    @results = task.state
    @audit_entry_data = task.details
  end
end
target() click to toggle source
# File lib/right_chimp/exec/exec_rightscript.rb, line 36
def target
  @server.nickname
end