From c8d3522f7dcc9785b331cb0ef2bf4ce7f5bff788 Mon Sep 17 00:00:00 2001 From: Adam Coldrick Date: Thu, 2 Apr 2015 15:19:54 +0000 Subject: fixup: ostreeartifactcache fixes --- morphlib/ostreeartifactcache.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/morphlib/ostreeartifactcache.py b/morphlib/ostreeartifactcache.py index 3a988ca6..a7602144 100644 --- a/morphlib/ostreeartifactcache.py +++ b/morphlib/ostreeartifactcache.py @@ -63,7 +63,6 @@ class OSTreeArtifactCache(object): temporary_download.close() def _get_artifact_cache_name(self, artifact): - logging.debug('LAC: %s' % artifact.basename()) cache_key, kind, name = artifact.basename().split('.', 2) suffix = name.split('-')[-1] return '%s-%s' % (cache_key, suffix) @@ -191,13 +190,15 @@ class OSTreeArtifactCache(object): cachekey, kind, name = artifact.basename().split('.', 2) logging.debug('OSTreeArtifactCache: checking for %s, %s, %s' % (cachekey, kind, name)) + if kind == 'stratum': + if self._has_file(self.artifact_filename(artifact)): + return True + else: + return False sha = self.repo.resolve_rev(self._get_artifact_cache_name(artifact)) if sha: self.repo.touch_ref(self._get_artifact_cache_name(artifact)) return True - if kind == 'stratum' and \ - self._has_file(self.artifact_filename(artifact)): - return True return False def get_artifact_metadata(self, artifact, name): -- cgit v1.2.1