From 6a363f65e3f2e1164305778d93101adf0d197556 Mon Sep 17 00:00:00 2001 From: cody burkard <cody@onlab.us> Date: Fri, 31 Oct 2014 04:59:35 -0700 Subject: [PATCH] unmount private directories after use --- mininet/node.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/mininet/node.py b/mininet/node.py index d762b250..299433a6 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -180,6 +180,14 @@ def mountPrivateDirs( self ): self.cmd( 'mkdir -p %s' % directory ) self.cmd( 'mount -n -t tmpfs tmpfs %s' % directory ) + def unmountPrivateDirs( self ): + "mount private directories" + for directory in self.privateDirs: + if isinstance( directory, tuple ): + self.cmd( 'umount ', directory[ 0 ] ) + else: + self.cmd( 'umount ', directory ) + def _popen( self, cmd, **params ): """Internal method: spawn and return a process cmd: command to run (list) @@ -229,6 +237,7 @@ def write( self, data ): def terminate( self ): "Send kill signal to Node and clean up after it." + self.unmountPrivateDirs() if self.shell: if self.shell.poll() is None: os.killpg( self.shell.pid, signal.SIGHUP ) -- GitLab