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
ceph-disk: include output of failed command in exception #20497
Conversation
Signed-off-by: Kefu Chai <kchai@redhat.com>
so i am able to debug failures like http://pulpito.ceph.com/kchai-2018-02-19_09:13:41-rados-wip-kefu-testing-2018-02-19-1111-distro-basic-mira/2204346 |
@@ -1251,7 +1251,7 @@ def get_conf_with_default(cluster, variable): | |||
except subprocess.CalledProcessError as e: | |||
raise Error( | |||
'getting variable from configuration failed', | |||
e, | |||
e, e.output, |
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.
This looks OK, but what if the CalledProcessError
is not coming from the modified one from _check_output
and it is really coming from subprocess
? You wouldn't get the output
that gets slapped there. Maybe a getattr(e, 'output', '')
?
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.
@alfredodeza, CalledProcessError
is raised by subprocess.check_call()
, subprocess.check_output()
and subprocess.CompletedProcess.check_returncode()
. it won't be raised by subprocess.Popen
's constructor or subprocess.Popen.communicate()
. i double checked the document and the source of py2.7 and py3.6.
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.
Man is this difficult to follow. You are right, the command()
is calling Popen
.
The most common thing is indeed to see what the forked command reports... |
the failures in the first run were caused by sepia issues. |
Signed-off-by: Kefu Chai kchai@redhat.com