This changeset is for the SSH drivers. The results of this change are that when an error is raised during execution, in either ssh-multi or not-multi, instead of a single file descriptor being raised with the error, a json hash containing the standard error/output by host will be raised.
tests
I did not update the tests because that would have been a nightmare because we use multi-ssh. I do however have a PR incoming for blender-integration which should cover the multi-ssh case.
concerns
@ranjib suggested allowing the user to change what type of object would receive the standard error / output. This is a really good idea, but I ran out of energy, so I would be happy to pass that work onto someone else :)
One other possible objection to this PR (brought up by @nickpegg in https://github.com/PagerDuty/blender/pull/50) is that I am changing the object type in the stderr and stdout fields in the object returned by run_command. A couple points on that:
different drivers return strings or file descriptors--it seems like the interface is not unified already, and at least a hash has meaningful output when printed vs a file descriptor
it seems to me like the main interface for the drivers is via the execute method, and not via run_command. In fact in another world I might be tempted to make run_command protected.
I can however address this if people think it's important, either by making the output returned by run_command a string, or a file descriptor.
summary
This changeset is for the SSH drivers. The results of this change are that when an error is raised during execution, in either ssh-multi or not-multi, instead of a single file descriptor being raised with the error, a json hash containing the standard error/output by host will be raised.
tests
I did not update the tests because that would have been a nightmare because we use multi-ssh. I do however have a PR incoming for blender-integration which should cover the multi-ssh case.
concerns
@ranjib suggested allowing the user to change what type of object would receive the standard error / output. This is a really good idea, but I ran out of energy, so I would be happy to pass that work onto someone else :)
One other possible objection to this PR (brought up by @nickpegg in https://github.com/PagerDuty/blender/pull/50) is that I am changing the object type in the
stderr
andstdout
fields in the object returned byrun_command
. A couple points on that:execute
method, and not viarun_command
. In fact in another world I might be tempted to makerun_command
protected.I can however address this if people think it's important, either by making the output returned by run_command a string, or a file descriptor.