diff options
author | Michael E Brown <mebrown@michaels-house.net> | 2007-12-04 00:54:55 -0600 |
---|---|---|
committer | Michael E Brown <mebrown@michaels-house.net> | 2007-12-04 00:54:55 -0600 |
commit | 9542ae007ed44ed0a047f2195967c05a49e84bda (patch) | |
tree | a8d6806ae291539079934513e317f6e8c2180a8d | |
parent | 613adbb0c28685b8aec3689eafc4e14dd10cabda (diff) | |
download | mock-9542ae007ed44ed0a047f2195967c05a49e84bda.tar.gz mock-9542ae007ed44ed0a047f2195967c05a49e84bda.tar.xz mock-9542ae007ed44ed0a047f2195967c05a49e84bda.zip |
make sure dir exists before opening yum lock.
-rw-r--r-- | py/mock/plugins/yum_cache.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/py/mock/plugins/yum_cache.py b/py/mock/plugins/yum_cache.py index 7da61a3..afc778e 100644 --- a/py/mock/plugins/yum_cache.py +++ b/py/mock/plugins/yum_cache.py @@ -38,6 +38,8 @@ class YumCache(object): rootObj.addHook("preinit", self._yumCachePreInitHook) rootObj.umountCmds.append('umount -n %s/var/cache/yum' % rootObj.rootdir) rootObj.mountCmds.append('mount -n --bind %s %s/var/cache/yum' % (self.yumSharedCachePath, rootObj.rootdir)) + mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'var/cache/yum')) + mock.util.mkdirIfAbsent(self.yumSharedCachePath) self.yumCacheLock = open(os.path.join(self.yumSharedCachePath, "yumcache.lock"), "a+") # ============= @@ -64,8 +66,6 @@ class YumCache(object): @traceLog(moduleLog) def _yumCachePreInitHook(self): moduleLog.info("enabled yum cache") - mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'var/cache/yum')) - mock.util.mkdirIfAbsent(self.yumSharedCachePath) # lock so others dont accidentally use yum cache while we operate on it. self._yumCachePreYumHook() |