close ipr to avoid fd leak
authorYonghong Song <yhs@plumgrid.com>
Wed, 12 Aug 2015 15:21:57 +0000 (08:21 -0700)
committerYonghong Song <yhs@plumgrid.com>
Wed, 12 Aug 2015 15:21:57 +0000 (08:21 -0700)
Signed-off-by: Yonghong Song <yhs@plumgrid.com>
examples/simulation.py

index e2c8b2d..aa9888d 100644 (file)
@@ -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()