summaryrefslogtreecommitdiffstats
path: root/src/py-libs
diff options
context:
space:
mode:
authorMichael E Brown <mebrown@michaels-house.net>2007-10-21 16:04:15 -0500
committerMichael E Brown <mebrown@michaels-house.net>2007-10-21 16:04:15 -0500
commitd192e14de3b40d6b736cafb14775f341e01caa19 (patch)
treedf9b30e74e76e84a0f990937b4c22066aff4b427 /src/py-libs
parenta75a61823cdf4574c1238e8343590b30e6ef15f4 (diff)
downloadmock-d192e14de3b40d6b736cafb14775f341e01caa19.tar.gz
mock-d192e14de3b40d6b736cafb14775f341e01caa19.tar.xz
mock-d192e14de3b40d6b736cafb14775f341e01caa19.zip
finish implementing bind mount plugin.
Diffstat (limited to 'src/py-libs')
-rw-r--r--src/py-libs/plugins/bind_mount.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/py-libs/plugins/bind_mount.py b/src/py-libs/plugins/bind_mount.py
index e2da4d7..e010f92 100644
--- a/src/py-libs/plugins/bind_mount.py
+++ b/src/py-libs/plugins/bind_mount.py
@@ -29,12 +29,11 @@ class BindMount(object):
self.rootdir = rootObj.rootdir
rootObj.bindMountObj = self
rootObj.addHook("preinit", self._bindMountPreInitHook)
- #rootObj.umountCmds.append('umount -n %s/tmp/ccache' % rootObj.rootdir)
- #rootObj.mountCmds.append('mount -n --bind %s %s/tmp/ccache' % (self.ccachePath, rootObj.rootdir))
+ for srcdir, destdir in self.bind_opts['dirs']:
+ rootObj.umountCmds.append('umount -n %s/%s' % (rootObj.rootdir, destdir))
+ rootObj.mountCmds.append('mount -n --bind %s %s/%s' % (srcdir, rootObj.rootdir, destdir))
@traceLog(moduleLog)
def _bindMountPreInitHook(self):
- #mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'tmp/ccache'))
- pass
-
-
+ for srcdir, destdir in self.bind_opts['dirs']:
+ mock.util.mkdirIfAbsent("%s/%s" % (self.rootObj.rootdir, destdir))