From 6d3d17f470be5a361ce14f9aab92920e9f057b09 Mon Sep 17 00:00:00 2001 From: Gabriel Somlo Date: Wed, 11 Oct 2017 14:54:27 -0400 Subject: [PATCH] SimpleLxcNode: Remove unused umount method The umount method was used to remove private mount points before tearing down a node. Since non-persistend mount namespaces are automatically cleaned up by he kernel, this method is now unused. Signed-off-by: Gabriel Somlo --- daemon/core/netns/vnode.py | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/daemon/core/netns/vnode.py b/daemon/core/netns/vnode.py index e7819a83..a50ebb07 100644 --- a/daemon/core/netns/vnode.py +++ b/daemon/core/netns/vnode.py @@ -117,11 +117,9 @@ class SimpleLxcNode(PyCoreNode): if not self.up: return - # unmount all targets - while self._mounts: - source, target = self._mounts.pop(-1) - # Mount namespaces automatically removed when last process exits! - #self.umount(target) + # unmount all targets (NOTE: non-persistent mount namespaces are + # removed by the kernel when last referencing process is killed) + self._mounts = [] # shutdown all interfaces for netif in self.netifs(): @@ -251,19 +249,6 @@ class SimpleLxcNode(PyCoreNode): except IOError: logger.exception("mounting failed for %s at %s", source, target) - def umount(self, target): - """ - Unmount a target directory. - - :param str target: target directory to unmount - :return: nothing - """ - logger.info("unmounting: %s", target) - try: - self.cmd([constants.UMOUNT_BIN, "-n", "-l", target]) - except IOError: - logger.exception("unmounting failed for %s" % target) - def newifindex(self): """ Retrieve a new interface index.