Sha256: 457e34660ec340efc3fec0155e3da88c85c1c4f3876dbafad9b16c767b37bbe9

Contents?: true

Size: 971 Bytes

Versions: 7

Compression:

Stored size: 971 Bytes

Contents

#
# Run a RightScript
#
module Chimp
  # Class that describes the execution for a rightscript
  class ExecRightScript < Executor
    attr_accessor :audit_entry_data, :audit_entry_url

    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

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

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

    def target
      @server.nickname
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
right_chimp-2.4 lib/right_chimp/exec/exec_rightscript.rb
right_chimp-2.3.2 lib/right_chimp/exec/exec_rightscript.rb
right_chimp-2.3.1 lib/right_chimp/exec/exec_rightscript.rb
right_chimp-2.3 lib/right_chimp/exec/exec_rightscript.rb
right_chimp-2.2.2 lib/right_chimp/exec/exec_rightscript.rb
right_chimp-2.2.1 lib/right_chimp/exec/exec_rightscript.rb
right_chimp-2.2 lib/right_chimp/exec/exec_rightscript.rb