summaryrefslogtreecommitdiff
path: root/ironic_python_agent/utils.py
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2016-03-15 17:01:44 +0000
committerGerrit Code Review <review@openstack.org>2016-03-15 17:01:44 +0000
commitc9f7c951dcd223caeadd27e7ddbba7a5169e9f2f (patch)
tree9e1fcf50774b7874c4d609594e50a218404bf0ce /ironic_python_agent/utils.py
parent21afeb4017116a193a58d182a4a94ce65fd8bafc (diff)
parent58f86d0353f6eacb0b6cccba96bb76a3d963ce6b (diff)
downloadironic-python-agent-c9f7c951dcd223caeadd27e7ddbba7a5169e9f2f.tar.gz
Merge "Stop trying to log stdout when fetching logs during inspection"
Diffstat (limited to 'ironic_python_agent/utils.py')
-rw-r--r--ironic_python_agent/utils.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/ironic_python_agent/utils.py b/ironic_python_agent/utils.py
index 49ee02b3..d647e2dd 100644
--- a/ironic_python_agent/utils.py
+++ b/ironic_python_agent/utils.py
@@ -53,15 +53,18 @@ def execute(*cmd, **kwargs):
oslo_concurrency.processutils.execute for usage.
:param *cmd: positional arguments to pass to processutils.execute()
+ :param log_stdout: keyword-only argument: whether to log the output
:param **kwargs: keyword arguments to pass to processutils.execute()
:raises: UnknownArgumentError on receiving unknown arguments
:raises: ProcessExecutionError
:raises: OSError
:returns: tuple of (stdout, stderr)
"""
+ log_stdout = kwargs.pop('log_stdout', True)
result = processutils.execute(*cmd, **kwargs)
LOG.debug('Execution completed, command line is "%s"', ' '.join(cmd))
- LOG.debug('Command stdout is: "%s"', result[0])
+ if log_stdout:
+ LOG.debug('Command stdout is: "%s"', result[0])
LOG.debug('Command stderr is: "%s"', result[1])
return result
@@ -76,6 +79,7 @@ def try_execute(*cmd, **kwargs):
returns None in case of failure.
:param *cmd: positional arguments to pass to processutils.execute()
+ :param log_stdout: keyword-only argument: whether to log the output
:param **kwargs: keyword arguments to pass to processutils.execute()
:raises: UnknownArgumentError on receiving unknown arguments
:returns: tuple of (stdout, stderr) or None in some error cases