projects
/
platform
/
upstream
/
bcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1bd744d
)
use pyroute2 IProute to remove the stale veth
author
Yonghong Song
<yhs@plumgrid.com>
Tue, 11 Aug 2015 02:04:58 +0000
(19:04 -0700)
committer
Yonghong Song
<yhs@plumgrid.com>
Wed, 12 Aug 2015 15:02:21 +0000
(08:02 -0700)
Signed-off-by: Yonghong Song <yhs@plumgrid.com>
examples/simulation.py
patch
|
blob
|
history
diff --git
a/examples/simulation.py
b/examples/simulation.py
index
9e2e677
..
e2c8b2d
100644
(file)
--- a/
examples/simulation.py
+++ b/
examples/simulation.py
@@
-48,8
+48,8
@@
class Simulation(object):
v.net_ns_fd = ns_ipdb.nl.netns
else:
# delete the potentially leaf-over veth interfaces
- subprocess.call(["ip", "link", "del", "%sa" % ifc_base_name],
-
stderr=open(os.devnull, 'w')
)
+ ipr = IPRoute()
+
for i in ipr.link_lookup(ifname='%sa' % ifc_base_name): ipr.link_remove(i
)
try:
out_ifc = self.ipdb.create(ifname="%sa" % ifc_base_name, kind="veth",
peer="%sb" % ifc_base_name).commit()