-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display stderr and stdout when run_command fails #40
Conversation
4ef9e5a
to
113c52e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
after fixing the tests ;)
The failing test is no longer relevant with this modification. However before changing(removing) it I want to be sure the implemantation won't change. |
Honestly, I think that is better to add a custom Exception class (ProcessException?) with these fields: stdout, stderr, command and returncode. |
6d09b2f
to
b0e56a3
Compare
b0e56a3
to
dbbe625
Compare
bce9459
to
0a2d4df
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM if the last iteration of the PR was tested manually (especially the updater plugin)
5cc3d89
to
657c6c3
Compare
It would be interesting to describe a bit more the original problem - is it that From what I see, in
Or at least we could make that new error class derive from |
657c6c3
to
cfb735d
Compare
|
cfb735d
to
4165dbd
Compare
class ProcessException(subprocess.CalledProcessError): | ||
def __init__(self, code, command, stderr, stdout): | ||
self.returncode = code | ||
self.command = command | ||
self.stderr = stderr | ||
self.stdout = stdout |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should now rather use super.__init__
then
4165dbd
to
3f631c2
Compare
c1555d5
to
e9168dc
Compare
Throwing a `CalledProcessError` would hide the messages when converted into a `Xenapi.Failure` use a generic `Exception` with a properly formed detail instead. Signed-off-by: BenjiReis <[email protected]>
e9168dc
to
6d1f822
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Throwing a
CalledProcessError
would hide themessages when converted into a
Xenapi.Failure
use a generic
Exception
with a properly formeddetail instead.