summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--py/mock/plugins/yum_cache.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/py/mock/plugins/yum_cache.py b/py/mock/plugins/yum_cache.py
index 109f3e0..d2460a4 100644
--- a/py/mock/plugins/yum_cache.py
+++ b/py/mock/plugins/yum_cache.py
@@ -8,6 +8,7 @@ import logging
import fcntl
import time
import os
+import glob
# our imports
from mock.trace_decorator import decorate, traceLog, getLog
@@ -89,5 +90,13 @@ class YumCache(object):
os.unlink(fullPath)
continue
+ # so yum made an rpmdb cache dir in $cachedir/installed for a while
+ # things can go wrong in a specific mock case if this happened.
+ # So - just nuke the dir and all that's in it
+ if os.path.exists(self.yumSharedCachePath + '/installed'):
+ for fn in glob.glob(self.yumSharedCachePath + '/installed/*'):
+ os.unlink(fn)
+ os.rmdir(self.yumSharedCachePath + '/installed')
+
self._yumCachePostYumHook()