diff options
author | Michael E Brown <michael_e_brown@dell.com> | 2007-12-18 14:44:16 -0600 |
---|---|---|
committer | Michael E Brown <mebrown@michaels-house.net> | 2007-12-20 22:11:50 -0600 |
commit | 62b9823cb90191d25dd9c03b705c845e6a0e66cd (patch) | |
tree | 5b93750267f9cac6c4851bc7ce193796de667d79 | |
parent | 0082fdc5f2a69c5e9e7e48a652785247d87807df (diff) | |
download | mock-62b9823cb90191d25dd9c03b705c845e6a0e66cd.tar.gz mock-62b9823cb90191d25dd9c03b705c845e6a0e66cd.tar.xz mock-62b9823cb90191d25dd9c03b705c845e6a0e66cd.zip |
unmount tmpfs when done or we run into problems with clean.
-rw-r--r-- | py/mock/plugins/tmpfs.py | 7 |
1 files changed, 7 insertions, 0 deletions
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) + + |