Skip to content
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

misc.py: sh helper to log command and output #530

Merged
merged 1 commit into from Jul 7, 2015
Merged

misc.py: sh helper to log command and output #530

merged 1 commit into from Jul 7, 2015

Conversation

ghost
Copy link

@ghost ghost commented Jun 19, 2015

It is the same as subprocess.check_output, only it log.debug the command
being run as well as its output.

Signed-off-by: Loic Dachary loic@dachary.org

@ceph-jenkins
Copy link

Refer to this link for build results (access rights to CI server needed):
http://jenkins.ceph.com//job/teuthology-pull-requests/1531/
Tests passed for this pull request.

@ghost ghost assigned zmc Jun 19, 2015
output = subprocess.check_output(command, stderr=subprocess.STDOUT,
shell=True)
except subprocess.CalledProcessError as e:
log.error(command + " error " + str(e.output))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

log.exception() would be useful here; it is the same as log.error() but adds the traceback for you.

It is the same as subprocess.check_output, only it log.debug the command
being run as well as its output.

Signed-off-by: Loic Dachary <loic@dachary.org>
@ghost
Copy link
Author

ghost commented Jul 1, 2015

Thanks for the review :-) I made the suggested changes and repushed.

@ceph-jenkins
Copy link

Refer to this link for build results (access rights to CI server needed):
http://jenkins.ceph.com//job/teuthology-pull-requests/1594/
Tests passed for this pull request.

zmc added a commit that referenced this pull request Jul 7, 2015
misc.py: sh helper to log command and output
@zmc zmc merged commit c59b9aa into ceph:master Jul 7, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants