lib/right_chimp/exec/Executor.rb in right_chimp-2.1.12 vs lib/right_chimp/exec/Executor.rb in right_chimp-2.1.13
- old
+ new
@@ -3,11 +3,11 @@
#
module Chimp
class Executor
attr_accessor :server, :array, :exec, :inputs, :template, :owner, :group,
- :job_id, :job_uuid, :status, :dry_run, :verbose, :quiet, :timeout,
+ :job_id, :job_uuid, :job_notes, :status, :dry_run, :verbose, :quiet, :timeout,
:retry_count, :retry_sleep, :time_start, :time_end, :error
attr_reader :results
STATUS_NONE = :none
@@ -22,10 +22,12 @@
@array = h[:array] || nil
@template = h[:template] || nil
@job_id = h[:job_id] || nil
@job_uuid = h[:job_uuid] || nil
+ @job_notes = h[:job_notes] || nil
+
@group = h[:group] || nil
@exec = h[:exec] || nil
@inputs = h[:inputs] || nil
@verbose = h[:verbose] || false
@@ -153,12 +155,21 @@
@time_end = Time.now
Log.info self.describe_work_done unless @quiet
end
rescue RuntimeError => ex
- Log.error "[#{@job_uuid}] Caught RuntimeError: #{ex}. Aborting job."
- Log.error ex.inspect
- Log.error ex.backtrace
+ if @server.params["ip_address"]
+ err = ex.message + "IP: #{@server.params["ip_address"]}\n"
+ end
+ if @group.group_id
+ err += " Group: #{@group.group_id}\n"
+ end
+ if @job_notes
+ err += " Notes: #{@job_notes}\n"
+ end
+ Log.error "[#{@job_uuid}] Caught RuntimeError: #{err} Aborting job.\n"
+ #Log.error ex.inspect
+ #Log.error ex.backtrace
@status = STATUS_ERROR
@error = ex
end
end