diff --git a/neutron_tempest_plugin/common/ip.py b/neutron_tempest_plugin/common/ip.py index e2f6a4aa..07bbe695 100644 --- a/neutron_tempest_plugin/common/ip.py +++ b/neutron_tempest_plugin/common/ip.py @@ -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