]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
utils.execute: Add a debug-level log to record stdin
authorYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 11 Mar 2015 05:33:28 +0000 (14:33 +0900)
committerYAMAMOTO Takashi <yamamoto@valinux.co.jp>
Wed, 11 Mar 2015 10:21:36 +0000 (19:21 +0900)
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

neutron/agent/linux/utils.py

index c6f2582befd589ad2e986e349677fedaa269b955..447208538134d93b1e9fd3ea90faf66b2077d986 100644 (file)
@@ -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: