summaryrefslogtreecommitdiffstats
path: root/py/mock/plugins/yum_cache.py
diff options
context:
space:
mode:
authorMichael E Brown <michael_e_brown@dell.com>2007-12-06 01:41:43 -0600
committerMichael E Brown <michael_e_brown@dell.com>2007-12-06 01:45:13 -0600
commitafeb84213c6f965850417c0f573e862472cbfc74 (patch)
tree32ee15d007f9c71aacce08f01db3d0c54fb7988a /py/mock/plugins/yum_cache.py
parent347cd1e7a399ff3692802044f866699cdb4dc3c9 (diff)
downloadmock-afeb84213c6f965850417c0f573e862472cbfc74.tar.gz
mock-afeb84213c6f965850417c0f573e862472cbfc74.tar.xz
mock-afeb84213c6f965850417c0f573e862472cbfc74.zip
separate out function tracing from verbosity
Diffstat (limited to 'py/mock/plugins/yum_cache.py')
-rw-r--r--py/mock/plugins/yum_cache.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/py/mock/plugins/yum_cache.py b/py/mock/plugins/yum_cache.py
index ed73a9d..5b371bb 100644
--- a/py/mock/plugins/yum_cache.py
+++ b/py/mock/plugins/yum_cache.py
@@ -10,21 +10,21 @@ import time
import os
# our imports
-from mock.trace_decorator import traceLog
+from mock.trace_decorator import decorate, traceLog, getLog
import mock.util
# set up logging, module options
-moduleLog = logging.getLogger("mock")
requires_api_version = "1.0"
# plugin entry point
+decorate(traceLog())
def init(rootObj, conf):
YumCache(rootObj, conf)
# classes
class YumCache(object):
"""caches root environment in a tarball"""
- @traceLog(moduleLog)
+ decorate(traceLog())
def __init__(self, rootObj, conf):
self.rootObj = rootObj
self.yum_cache_opts = conf
@@ -48,7 +48,7 @@ class YumCache(object):
# by yum, and prior to cleaning it. This prevents simultaneous access from
# screwing things up. This can possibly happen, eg. when running multiple
# mock instances with --uniqueext=
- @traceLog(moduleLog)
+ decorate(traceLog())
def _yumCachePreYumHook(self):
try:
fcntl.lockf(self.yumCacheLock.fileno(), fcntl.LOCK_EX | fcntl.LOCK_NB)
@@ -58,13 +58,13 @@ class YumCache(object):
fcntl.lockf(self.yumCacheLock.fileno(), fcntl.LOCK_EX)
self.state(oldState)
- @traceLog(moduleLog)
+ decorate(traceLog())
def _yumCachePostYumHook(self):
fcntl.lockf(self.yumCacheLock.fileno(), fcntl.LOCK_UN)
- @traceLog(moduleLog)
+ decorate(traceLog())
def _yumCachePreInitHook(self):
- moduleLog.info("enabled yum cache")
+ getLog().info("enabled yum cache")
mock.util.mkdirIfAbsent(os.path.join(self.rootdir, 'var/cache/yum'))
# lock so others dont accidentally use yum cache while we operate on it.