diff options
author | Michael E Brown <michael_e_brown@dell.com> | 2008-01-08 13:59:05 -0600 |
---|---|---|
committer | Michael E Brown <michael_e_brown@dell.com> | 2008-01-08 13:59:05 -0600 |
commit | cc889dbb4ed40909ffd6c29bc29623cfcf1a1ca5 (patch) | |
tree | 267a3c445488c762f13166b4cb94ad284e8099e2 /py/mock/plugins/tmpfs.py | |
parent | 552c3bbe3331f5a7727010a0420d11159777ea90 (diff) | |
download | mock-cc889dbb4ed40909ffd6c29bc29623cfcf1a1ca5.tar.gz mock-cc889dbb4ed40909ffd6c29bc29623cfcf1a1ca5.tar.xz mock-cc889dbb4ed40909ffd6c29bc29623cfcf1a1ca5.zip |
add initfailed hook so tmpfs plugin can properly unmount tmpfs on failure. make sure we call postbuild hooks even on failure.
Diffstat (limited to 'py/mock/plugins/tmpfs.py')
-rw-r--r-- | py/mock/plugins/tmpfs.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/py/mock/plugins/tmpfs.py b/py/mock/plugins/tmpfs.py index b725fb9..74c39a1 100644 --- a/py/mock/plugins/tmpfs.py +++ b/py/mock/plugins/tmpfs.py @@ -26,6 +26,7 @@ class Tmpfs(object): self.conf = conf rootObj.addHook("preinit", self._tmpfsPreInitHook) rootObj.addHook("postbuild", self._tmpfsPostBuildHook) + rootObj.addHook("initfailed", self._tmpfsPostBuildHook) decorate(traceLog()) def _tmpfsPreInitHook(self): @@ -33,6 +34,7 @@ class Tmpfs(object): mountCmd = "mount -n -t tmpfs mock_chroot_tmpfs %s" % self.rootObj.makeChrootPath() mock.util.do(mountCmd) + decorate(traceLog()) def _tmpfsPostBuildHook(self): getLog().info("unmounting tmpfs.") mountCmd = "umount -n %s" % self.rootObj.makeChrootPath() |