diff options
author | Jürg Billeter <j@bitron.ch> | 2018-02-26 20:16:57 +0100 |
---|---|---|
committer | Tristan Van Berkom <tristan.van.berkom@gmail.com> | 2018-02-27 11:43:15 +0000 |
commit | 7100e0db548b6ea1a504feff98867dca886f18c7 (patch) | |
tree | 1c0d17dd15a7e205f32063a1d9856db4b145270a /buildstream/_artifactcache/tarcache.py | |
parent | 0c4f62ac4da67a2f3e5cd12811078f90124a89ee (diff) | |
download | buildstream-7100e0db548b6ea1a504feff98867dca886f18c7.tar.gz |
_artifactcache: Add key parameter to contains() method
Contain cache key logic in Element class.
Diffstat (limited to 'buildstream/_artifactcache/tarcache.py')
-rw-r--r-- | buildstream/_artifactcache/tarcache.py | 12 |
1 files changed, 1 insertions, 11 deletions
diff --git a/buildstream/_artifactcache/tarcache.py b/buildstream/_artifactcache/tarcache.py index fa42506ef..d1d6c035a 100644 --- a/buildstream/_artifactcache/tarcache.py +++ b/buildstream/_artifactcache/tarcache.py @@ -248,17 +248,7 @@ class TarCache(ArtifactCache): # # Implements artifactcache.contains(). # - def contains(self, element, strength=None): - if strength is None: - strength = _KeyStrength.STRONG if element._get_strict() else _KeyStrength.WEAK - - if strength == _KeyStrength.STRONG: - key = element._get_strict_cache_key() - else: - key = element._get_cache_key(strength) - if not key: - return False - + def contains(self, element, key): path = os.path.join(self.tardir, tarpath(element, key)) return os.path.isfile(path) |