summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbst-marge-bot <marge-bot@buildstream.build>2019-03-14 12:27:02 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-03-14 12:27:02 +0000
commitc991a066ab42b14662a798b7e0fe2dd127672395 (patch)
tree79d00b5288cd0d747108032d6d47dd4e413d404d
parentf8c60c6c9951003b306975874891e29253055c0c (diff)
parentedd440721f28ac1db087509a2b99f5a4a57fa802 (diff)
downloadbuildstream-c991a066ab42b14662a798b7e0fe2dd127672395.tar.gz
Merge branch 'juerg/cas' into 'master'
_casbaseddirectory.py: Use variable-length argument list See merge request BuildStream/buildstream!1230
-rw-r--r--buildstream/_artifact.py12
-rw-r--r--buildstream/storage/_casbaseddirectory.py4
2 files changed, 8 insertions, 8 deletions
diff --git a/buildstream/_artifact.py b/buildstream/_artifact.py
index 45ea53408..0c1e71194 100644
--- a/buildstream/_artifact.py
+++ b/buildstream/_artifact.py
@@ -241,7 +241,7 @@ class Artifact():
# Load the public data from the artifact
artifact_vdir, _ = self._get_directory()
- meta_file = artifact_vdir._objpath(['meta', 'public.yaml'])
+ meta_file = artifact_vdir._objpath('meta', 'public.yaml')
data = _yaml.load(meta_file, shortname='meta/public.yaml')
return data
@@ -263,7 +263,7 @@ class Artifact():
assert key is not None
artifact_vdir, _ = self._get_directory(key)
- meta_file = artifact_vdir._objpath(['meta', 'build-result.yaml'])
+ meta_file = artifact_vdir._objpath('meta', 'build-result.yaml')
if not os.path.exists(meta_file):
build_result = (True, "succeeded", None)
return build_result
@@ -298,7 +298,7 @@ class Artifact():
metadata_keys[key]['weak'], None)
# Parse the expensive yaml now and cache the result
- meta_file = artifact_vdir._objpath(['meta', 'keys.yaml'])
+ meta_file = artifact_vdir._objpath('meta', 'keys.yaml')
meta = _yaml.load(meta_file, shortname='meta/keys.yaml')
strong_key = meta['strong']
weak_key = meta['weak']
@@ -336,7 +336,7 @@ class Artifact():
return (metadata_dependencies[key], None, None)
# Parse the expensive yaml now and cache the result
- meta_file = artifact_vdir._objpath(['meta', 'dependencies.yaml'])
+ meta_file = artifact_vdir._objpath('meta', 'dependencies.yaml')
meta = _yaml.load(meta_file, shortname='meta/dependencies.yaml')
# Cache it under both strong and weak keys
@@ -373,7 +373,7 @@ class Artifact():
return (metadata_workspaced[key], None, None)
# Parse the expensive yaml now and cache the result
- meta_file = artifact_vdir._objpath(['meta', 'workspaced.yaml'])
+ meta_file = artifact_vdir._objpath('meta', 'workspaced.yaml')
meta = _yaml.load(meta_file, shortname='meta/workspaced.yaml')
workspaced = meta['workspaced']
@@ -412,7 +412,7 @@ class Artifact():
return (metadata_workspaced_dependencies[key], None, None)
# Parse the expensive yaml now and cache the result
- meta_file = artifact_vdir._objpath(['meta', 'workspaced-dependencies.yaml'])
+ meta_file = artifact_vdir._objpath('meta', 'workspaced-dependencies.yaml')
meta = _yaml.load(meta_file, shortname='meta/workspaced-dependencies.yaml')
workspaced = meta['workspaced-dependencies']
diff --git a/buildstream/storage/_casbaseddirectory.py b/buildstream/storage/_casbaseddirectory.py
index 91e11888d..ec0fb36da 100644
--- a/buildstream/storage/_casbaseddirectory.py
+++ b/buildstream/storage/_casbaseddirectory.py
@@ -577,12 +577,12 @@ class CasBasedDirectory(Directory):
return self.__digest
- def _objpath(self, path):
+ def _objpath(self, *path):
subdir = self.descend(*path[:-1])
entry = subdir.index[path[-1]]
return self.cas_cache.objpath(entry.digest)
- def _exists(self, path):
+ def _exists(self, *path):
try:
subdir = self.descend(*path[:-1])
return path[-1] in subdir.index