Bug fixing Netns emulation
[nepi.git] / src / nepi / resources / netns / netnswrapper.py
index f2e1e7a..74bd69a 100644 (file)
@@ -18,7 +18,6 @@
 # Author: Alina Quereilhac <alina.quereilhac@inria.fr>
 
 import logging
-import netns
 import time
 import os
 import sys
@@ -54,6 +53,7 @@ class NetNSWrapper(object):
  
     def create(self, clazzname, *args):
         """ This method should be used to construct netns objects """
+        import netns
 
         if clazzname not in ['open'] and not hasattr(netns, clazzname):
             msg = "Type %s not supported" % (clazzname) 
@@ -164,9 +164,13 @@ class NetNSWrapper(object):
         self.debuger.dump_shutdown()
         ########
 
+        ### FLUSH PIPES
         sys.stdout.flush()
         sys.stderr.flush()
 
+        ### RELEASE OBJECTS
+        del self._objects 
+
         ### DEBUG
         self.logger.debug("SHUTDOWN")
         ########