From d192e14de3b40d6b736cafb14775f341e01caa19 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Sun, 21 Oct 2007 16:04:15 -0500 Subject: finish implementing bind mount plugin. --- src/py-libs/plugins/bind_mount.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/py-libs/plugins/bind_mount.py') 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)) -- cgit