From 184afb1852bccc8e9d1b38dea05f30af1180f122 Mon Sep 17 00:00:00 2001 From: Michael E Brown Date: Fri, 14 Dec 2007 16:27:39 -0600 Subject: remove uses of chroot rootdir attribute and use accessor. --- py/mock/plugins/bind_mount.py | 1 - py/mock/plugins/root_cache.py | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/py/mock/plugins/bind_mount.py b/py/mock/plugins/bind_mount.py index df5e215..ff531f0 100644 --- a/py/mock/plugins/bind_mount.py +++ b/py/mock/plugins/bind_mount.py @@ -25,7 +25,6 @@ class BindMount(object): def __init__(self, rootObj, conf): self.rootObj = rootObj self.bind_opts = conf - self.rootdir = rootObj.rootdir rootObj.bindMountObj = self rootObj.addHook("preinit", self._bindMountPreInitHook) for srcdir, destdir in self.bind_opts['dirs']: diff --git a/py/mock/plugins/root_cache.py b/py/mock/plugins/root_cache.py index 5082925..6e9c60e 100644 --- a/py/mock/plugins/root_cache.py +++ b/py/mock/plugins/root_cache.py @@ -30,7 +30,6 @@ class RootCache(object): self.rootCacheFile = os.path.join(self.rootSharedCachePath, "cache.tar.gz") self.rootCacheLock = None self.state = rootObj.state - self.rootdir = rootObj.rootdir rootObj.rootCacheObj = self rootObj.addHook("preinit", self._rootCachePreInitHook) rootObj.addHook("postinit", self._rootCachePostInitHook) @@ -75,7 +74,7 @@ class RootCache(object): if os.path.exists(self.rootCacheFile) and self.rootObj.chrootWasCleaned: self.state("unpacking cache") self._rootCacheLock() - mock.util.do("tar xzf %s -C %s" % (self.rootCacheFile, self.rootdir)) + mock.util.do("tar xzf %s -C %s" % (self.rootCacheFile, self.rootObj.makeChrootPath())) self._rootCacheUnlock() self.chroot_setup_cmd = "update" self.rootObj.chrootWasCleaned = False @@ -86,6 +85,6 @@ class RootCache(object): if self.rootObj.chrootWasCleaned: self.state("creating cache") self._rootCacheLock(shared=0) - mock.util.do("tar czf %s -C %s ." % (self.rootCacheFile, self.rootdir)) + mock.util.do("tar czf %s -C %s ." % (self.rootCacheFile, self.rootObj.makeChrootPath())) self._rootCacheUnlock() -- cgit