Class: SSHKit::Command
- Inherits:
-
Object
- Object
- SSHKit::Command
- Defined in:
- lib/sshkit/monkeypatches.rb
Instance Method Summary collapse
-
#exit_status=(new_exit_status) ⇒ Object
returns the full contents of stdout when an error occurs rather than just the first line (needed for chef debugging).
Instance Method Details
#exit_status=(new_exit_status) ⇒ Object
returns the full contents of stdout when an error occurs rather than just the first line (needed for chef debugging)
4 5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/sshkit/monkeypatches.rb', line 4 def exit_status=(new_exit_status) @finished_at = Time.now @exit_status = new_exit_status if [:raise_on_non_zero_exit] && exit_status > 0 = "" += "#{command} exit status: " + exit_status.to_s + "\n" += "#{command} stdout: " + (full_stdout.strip || "Nothing written") + "\n" += "#{command} stderr: " + (full_stderr.strip || 'Nothing written') + "\n\n" raise Failed, end end |