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
Log command output in CsHelper.execute command #2568
Log command output in CsHelper.execute command #2568
Conversation
|
@rafaelweingartner a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1914 |
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.
Great!! It would definitely help while debugging.
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.
to be clear this will not be output by default, will it?
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
| @@ -188,6 +188,8 @@ def execute(command): | |||
| logging.info("Executing: %s" % command) | |||
| result = subprocess.check_output(command, shell=True) | |||
| returncode = 0 | |||
|
|
|||
| logging.debug("Command [%s] has the result [%s]" % (command, result)) | |||
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.
@rafaelweingartner this may quickly fill up /var/log, otherwise LGTM.
|
@rhtyd it is not enabled by default. That is why I used the 'DEBUG' level. |
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.
:=1:
|
@rafaelweingartner a Jenkins job has been kicked to build packages. I'll keep you posted as I make progress. |
|
Packaging result: ✔centos6 ✔centos7 ✔debian. JID-1921 |
Description
While debugging some problems in our VRs, we noticed that the result of commands (e.g. iptables) was not being logged. It is interesting to log these information (at least in debug level) to facilitate troubleshooting.
This PR enables
CsHelper.executeto log DEBUG level the result of commands being executed.Types of changes
How Has This Been Tested?
Locally
Checklist:
Testing
@blueorangutan package