worlddump: collect networking stack info from namespaces

Neutron hugely relies on namespaces, so we should try to dump
internal IP stack state for non-root network namespaces.

Change-Id: Ib980d22fbf3c6b680473754fa2b1684c2ef91b72
This commit is contained in:
Ihar Hrachyshka 2016-01-30 16:18:01 +01:00
parent 13d255d90d
commit 72c34ee1aa

View File

@ -100,14 +100,24 @@ def iptables_dump():
_dump_cmd("sudo iptables --line-numbers -L -nv -t %s" % table)
def _netns_list():
process = subprocess.Popen(['ip', 'netns'], stdout=subprocess.PIPE)
stdout, _ = process.communicate()
return stdout.split()
def network_dump():
_header("Network Dump")
_dump_cmd("brctl show")
_dump_cmd("arp -n")
_dump_cmd("ip addr")
_dump_cmd("ip link")
_dump_cmd("ip route")
ip_cmds = ["addr", "link", "route"]
for cmd in ip_cmds + ['netns']:
_dump_cmd("ip %s" % cmd)
for netns_ in _netns_list():
for cmd in ip_cmds:
args = {'netns': netns_, 'cmd': cmd}
_dump_cmd('sudo ip netns exec %(netns)s ip %(cmd)s' % args)
def process_list():