Merge "Fix error in 'ip netns' parsing"

This commit is contained in:
Jenkins 2017-02-26 21:43:54 +00:00 committed by Gerrit Code Review
commit 6f23555c95

View File

@ -153,7 +153,11 @@ def iptables_dump():
def _netns_list():
process = subprocess.Popen(['ip', 'netns'], stdout=subprocess.PIPE)
stdout, _ = process.communicate()
return stdout.split()
# NOTE(jlvillal): Sometimes 'ip netns list' can return output like:
# qrouter-0805fd7d-c493-4fa6-82ca-1c6c9b23cd9e (id: 1)
# qdhcp-bb2cc6ae-2ae8-474f-adda-a94059b872b5 (id: 0)
output = [x.split()[0] for x in stdout.splitlines()]
return output
def network_dump():