update iptables rules for more useful debugging

As discussed with dansmith in #openstack-nova,
iptables --line-numbers -L -nv is a more useful representation of
the iptables dump for determining network issues.

Related-Bug: #1298472

Change-Id: Ibae97f7a0cf29105e3601eca8ce24b8271a3a13d
This commit is contained in:
Sean Dague 2014-07-02 11:12:26 -04:00
parent ff72f45628
commit 8976c9dd66
2 changed files with 3 additions and 2 deletions

View File

@ -50,7 +50,7 @@ def ip_ns_raw():
def iptables_raw(table):
return sudo_cmd_call("iptables -v -S -t " + table)
return sudo_cmd_call("iptables --line-numbers -L -nv -t " + table)
def ip_ns_list():

View File

@ -47,7 +47,8 @@ class TestCommands(base.TestCase):
@mock.patch('subprocess.Popen')
def test_iptables_raw(self, mock):
table = 'filter'
expected = ['/usr/bin/sudo', '-n', 'iptables', '-v', '-S', '-t',
expected = ['/usr/bin/sudo', '-n', 'iptables', '--line-numbers',
'-L', '-nv', '-t',
'%s' % table]
commands.iptables_raw(table)
mock.assert_called_once_with(expected, **self.subprocess_args)