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):
|
def list_iptables(version=constants.IP_VERSION_4, namespace=None):
|
||||||
cmd = ''
|
cmd = 'sudo '
|
||||||
if namespace:
|
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
|
cmd += ('iptables-save' if version == constants.IP_VERSION_4 else
|
||||||
'ip6tables-save')
|
'ip6tables-save')
|
||||||
return shell.execute(cmd).stdout
|
return shell.execute(cmd).stdout
|
||||||
|
Loading…
Reference in New Issue
Block a user