Commit fd4e4a5f authored by Brenden Blanco's avatar Brenden Blanco

Bugfix for simulation.py

* Ignore exceptions and continue cleanup of dead children
* Set loopback interface up
Signed-off-by: default avatarBrenden Blanco <bblanco@plumgrid.com>
parent ffaee08c
...@@ -37,6 +37,7 @@ class Simulation(object): ...@@ -37,6 +37,7 @@ class Simulation(object):
v.net_ns_fd = ns_ipdb.nl.netns v.net_ns_fd = ns_ipdb.nl.netns
in_ifc = ns_ipdb.interfaces[in_ifname] in_ifc = ns_ipdb.interfaces[in_ifname]
if out_ifc: out_ifc.up().commit() if out_ifc: out_ifc.up().commit()
ns_ipdb.interfaces.lo.up().commit()
with in_ifc as v: with in_ifc as v:
v.ifname = ns_ifc v.ifname = ns_ifc
if ipaddr: v.add_ip("%s" % ipaddr) if ipaddr: v.add_ip("%s" % ipaddr)
...@@ -73,7 +74,13 @@ class Simulation(object): ...@@ -73,7 +74,13 @@ class Simulation(object):
self.released = True self.released = True
for p in self.processes: for p in self.processes:
if p.released: continue if p.released: continue
p.kill(); p.wait(); p.release() try:
p.kill()
p.wait()
except:
pass
finally:
p.release()
for name, db in self.ipdbs.items(): db.release() for name, db in self.ipdbs.items(): db.release()
for ns in self.namespaces: ns.remove() for ns in self.namespaces: ns.remove()
// Copyright (c) PLUMgrid, Inc.
// Licensed under the Apache License, Version 2.0 (the "License")
#include <bcc/proto.h> #include <bcc/proto.h>
struct ipkey { struct ipkey {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment