lib/judges/commands/pull.rb in judges-0.21.0 vs lib/judges/commands/pull.rb in judges-0.22.0
- old
+ new
@@ -49,12 +49,17 @@
loog: @loog,
retries: (opts['retries'] || 3).to_i
)
name = args[0]
elapsed(@loog) do
+ baza.lock(name, opts['owner'])
if baza.name_exists?(name)
- baza.lock(name, opts['owner'])
- fb.import(baza.pull(wait(name, baza, baza.recent(name), opts['wait'])))
+ jid = baza.recent(name)
+ unless baza.exit_code(jid).zero?
+ @loog.warn("STDOUT of the job ##{jid} (from the server):\n#{baza.stdout(jid)}")
+ raise "The job ##{jid} ('#{name}') is broken, maybe you should expire it"
+ end
+ fb.import(baza.pull(wait(name, baza, jid, opts['wait'])))
Judges::Impex.new(@loog, args[1]).export(fb)
throw :"Pulled #{fb.size} facts by the name '#{name}'"
else
throw :"There is nothing to pull, the name '#{name}' is absent on the server"
end