From bb195338e4144929c193a6b5bf0e8024d551c885 Mon Sep 17 00:00:00 2001 From: armando-migliaccio Date: Tue, 13 Jan 2015 16:45:16 -0800 Subject: [PATCH] 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 --- neutron/agent/linux/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 [] -- 2.45.2