]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
Log iptables rules in a readable format
authorarmando-migliaccio <armamig@gmail.com>
Wed, 14 Jan 2015 00:45:16 +0000 (16:45 -0800)
committerarmando-migliaccio <armamig@gmail.com>
Wed, 14 Jan 2015 00:46:57 +0000 (16:46 -0800)
When troubleshooting issues having to parse the \n mentally is kind of
difficult. Be nice to the user and have the newlines interpreted correctly.
It's fine if we waste some spaces in the logs, storage is cheap these days.

Related-bug: #1403291

Change-Id: Ia6c651ae0d17c0165e4fe833c523061a66f7d7d1

neutron/agent/linux/utils.py

index 99e0e042233b0ef9e716adad6fef05cdca480d1d..45933080605329ae4421414b9f4ad2170fcf4391 100644 (file)
@@ -65,8 +65,8 @@ def execute(cmd, root_helper=None, 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)r\n"
-              "Stderr: %(stderr)r") % {'cmd': cmd, 'code': obj.returncode,
+        m = _("\nCommand: %(cmd)s\nExit code: %(code)s\nStdout: %(stdout)s\n"
+              "Stderr: %(stderr)s") % {'cmd': cmd, 'code': obj.returncode,
                                        'stdout': _stdout, 'stderr': _stderr}
 
         extra_ok_codes = extra_ok_codes or []