From 32cbdd2d00964cd7adb74de63b047a2cf7f3b5c5 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Tue, 18 Dec 2007 14:44:16 -0600 Subject: unmount tmpfs when done or we run into problems with clean. --- py/mock/plugins/tmpfs.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/py/mock/plugins/tmpfs.py b/py/mock/plugins/tmpfs.py index 91762f4..b725fb9 100644 --- a/py/mock/plugins/tmpfs.py +++ b/py/mock/plugins/tmpfs.py @@ -25,6 +25,7 @@ class Tmpfs(object): self.rootObj = rootObj self.conf = conf rootObj.addHook("preinit", self._tmpfsPreInitHook) + rootObj.addHook("postbuild", self._tmpfsPostBuildHook) decorate(traceLog()) def _tmpfsPreInitHook(self): @@ -32,3 +33,9 @@ class Tmpfs(object): mountCmd = "mount -n -t tmpfs mock_chroot_tmpfs %s" % self.rootObj.makeChrootPath() mock.util.do(mountCmd) + def _tmpfsPostBuildHook(self): + getLog().info("unmounting tmpfs.") + mountCmd = "umount -n %s" % self.rootObj.makeChrootPath() + mock.util.do(mountCmd) + + -- cgit