diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-12-18 15:23:16 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-12-18 15:23:16 +0000 |
commit | f352c4e7804f64a29670c23e50cff3c56a902496 (patch) | |
tree | a4ba65e01433664803a42cc6fc06bd6ffcd734a9 /morphlib/remoteartifactcache.py | |
parent | c853e4aa39c978054c037d1e7061e939427d495c (diff) | |
download | morph-f352c4e7804f64a29670c23e50cff3c56a902496.tar.gz |
Silence log messages during unit tests
Diffstat (limited to 'morphlib/remoteartifactcache.py')
-rw-r--r-- | morphlib/remoteartifactcache.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/morphlib/remoteartifactcache.py b/morphlib/remoteartifactcache.py index e50c1159..17f547f2 100644 --- a/morphlib/remoteartifactcache.py +++ b/morphlib/remoteartifactcache.py @@ -67,18 +67,18 @@ class RemoteArtifactCache(object): filename = '%s.%s' % (cachekey, name) return self._has_file(filename) - def get(self, artifact): + def get(self, artifact, log=logging.error): try: return self._get_file(artifact.basename()) except urllib2.URLError, e: - logging.error(str(e)) + log(str(e)) raise GetError(self, artifact) - def get_artifact_metadata(self, artifact, name): + def get_artifact_metadata(self, artifact, name, log=logging.error): try: return self._get_file(artifact.metadata_basename(name)) except urllib2.URLError, e: - logging.error(str(e)) + log(str(e)) raise GetArtifactMetadataError(self, artifact, name) def get_source_metadata(self, source, cachekey, name): |