Commit df73a828 authored by Yonghong Song's avatar Yonghong Song

close ipr to avoid fd leak

Signed-off-by: default avatarYonghong Song <yhs@plumgrid.com>
parent 83f800f6
......@@ -50,6 +50,7 @@ class Simulation(object):
# delete the potentially leaf-over veth interfaces
ipr = IPRoute()
for i in ipr.link_lookup(ifname='%sa' % ifc_base_name): ipr.link_remove(i)
ipr.close()
try:
out_ifc = self.ipdb.create(ifname="%sa" % ifc_base_name, kind="veth",
peer="%sb" % ifc_base_name).commit()
......
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