From: YAMAMOTO Takashi Date: Wed, 11 Mar 2015 05:33:28 +0000 (+0900) Subject: utils.execute: Add a debug-level log to record stdin X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=eaea63e7f4b6d5c023765906e2daf0a6fb97de8d;p=openstack-build%2Fneutron-build.git utils.execute: Add a debug-level log to record stdin It's important to record stdin than it used to be because the recent versions of ovs_lib passes flow strings to ovs-ofctl command via stdin. Change-Id: I3b3d5742076e05a3d4ebf5adc26356742b2928e4 --- diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py index c6f2582be..447208538 100644 --- a/neutron/agent/linux/utils.py +++ b/neutron/agent/linux/utils.py @@ -70,9 +70,13 @@ def execute(cmd, process_input=None, addl_env=None, addl_env=addl_env) _stdout, _stderr = obj.communicate(process_input) obj.stdin.close() - m = _("\nCommand: %(cmd)s\nExit code: %(code)s\nStdout: %(stdout)s\n" - "Stderr: %(stderr)s") % {'cmd': cmd, 'code': obj.returncode, - 'stdout': _stdout, 'stderr': _stderr} + m = _("\nCommand: %(cmd)s\nExit code: %(code)s\nStdin: %(stdin)s\n" + "Stdout: %(stdout)s\nStderr: %(stderr)s") % \ + {'cmd': cmd, + 'code': obj.returncode, + 'stdin': process_input or '', + 'stdout': _stdout, + 'stderr': _stderr} extra_ok_codes = extra_ok_codes or [] if obj.returncode and obj.returncode in extra_ok_codes: