Merge "Always run iptables-save as root"
This commit is contained in:
commit
6e4d04071b
@ -391,9 +391,9 @@ def arp_table(namespace=None):
|
||||
|
||||
|
||||
def list_iptables(version=constants.IP_VERSION_4, namespace=None):
|
||||
cmd = ''
|
||||
cmd = 'sudo '
|
||||
if namespace:
|
||||
cmd = 'sudo ip netns exec %s ' % namespace
|
||||
cmd += 'ip netns exec %s ' % namespace
|
||||
cmd += ('iptables-save' if version == constants.IP_VERSION_4 else
|
||||
'ip6tables-save')
|
||||
return shell.execute(cmd).stdout
|
||||
|
Loading…
Reference in New Issue
Block a user