From: armando-migliaccio Date: Wed, 14 Jan 2015 00:45:16 +0000 (-0800) Subject: Log iptables rules in a readable format X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=bb195338e4144929c193a6b5bf0e8024d551c885;p=openstack-build%2Fneutron-build.git Log iptables rules in a readable format 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 --- diff --git a/neutron/agent/linux/utils.py b/neutron/agent/linux/utils.py index 99e0e0422..459330806 100644 --- a/neutron/agent/linux/utils.py +++ b/neutron/agent/linux/utils.py @@ -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 []