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
This commit is contained in:
armando-migliaccio 2015-01-13 16:45:16 -08:00
parent efe5e47e03
commit bb195338e4
1 changed files with 2 additions and 2 deletions

View 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 []