summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2007-12-03 11:08:49 -0600
committerMichael E Brown <michael_e_brown@dell.com>2007-12-03 11:08:49 -0600
commitf309d57591a74c19cc0723d9dcdba65fcdd667e1 (patch)
treec99609a5021caab4897633b37b696cda4b93d750
parent5b3ff3ddd3fc5ceeac6f876a73cbbe476aba9d24 (diff)
downloadmock-f309d57591a74c19cc0723d9dcdba65fcdd667e1.tar.gz
mock-f309d57591a74c19cc0723d9dcdba65fcdd667e1.tar.xz
mock-f309d57591a74c19cc0723d9dcdba65fcdd667e1.zip
init yumCacheLock file object in __init__. No need to wait until tryLock to open it.
-rw-r--r--py/mock/plugins/yum_cache.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/py/mock/plugins/yum_cache.py b/py/mock/plugins/yum_cache.py
index be2e44e..7da61a3 100644
--- a/py/mock/plugins/yum_cache.py
+++ b/py/mock/plugins/yum_cache.py
@@ -38,6 +38,7 @@ 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))
+ self.yumCacheLock = open(os.path.join(self.yumSharedCachePath, "yumcache.lock"), "a+")
# =============
# 'Private' API
@@ -67,7 +68,6 @@ class YumCache(object):
mock.util.mkdirIfAbsent(self.yumSharedCachePath)
# lock so others dont accidentally use yum cache while we operate on it.
- self.yumCacheLock = open(os.path.join(self.yumSharedCachePath, "yumcache.lock"), "a+")
self._yumCachePreYumHook()
if self.online: