PagerDuty / blender

A modular orchestration engine
https://github.com/PagerDuty/blender
Other
183 stars 8 forks source link

Idea to fix output when executing a command that fails. #50

Closed margueritepd closed 8 years ago

margueritepd commented 8 years ago

Throwing this out here. This is to fix the output when an ssh command exits with non-zero status. The output currently is:

Blender::ExecutionFailed: #<File:0x00562760b79ca0>

With this change, the output would be the content of stderr.

Feedback I would like to get:

If this PR seems reasonable, I will put up a different PR with tests, etc.

ranjib commented 8 years ago

:+1: once specs fixed.

nickpegg commented 8 years ago

You could use a StringIO instead of a temp file if you wanted to avoid touching disk.

:+1: Looks reasonable to me, but will be breaking behavior if anyone is relying on ExecOutput to have IOs for stdout/stderr.

Sarah-E-Greene commented 8 years ago

:+1: Seems like a good plan to me.

ranjib commented 8 years ago

@margueritepd i have pushed an example spec here: https://github.com/PagerDuty/blender/blob/readable_error_msg_spec/spec/blender/drivers/ssh_spec.rb#L19

margueritepd commented 8 years ago

I have a possibly better solution to this, closing now.