diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-02-28 17:40:48 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-03-12 18:11:28 +0000 |
commit | 21c4633481575a96139500f919d8bb54a4b7861c (patch) | |
tree | 5cf460dbbbea0263263fcc32c85eb6013a538d51 /buildstream/element.py | |
parent | 9bba8f45880684408c8eed53ed2050689c06306e (diff) | |
download | buildstream-21c4633481575a96139500f919d8bb54a4b7861c.tar.gz |
_artifact.py: Transition element.py __load*() methods
This includes __load_public_data() & __load_build_result().
Diffstat (limited to 'buildstream/element.py')
-rw-r--r-- | buildstream/element.py | 24 |
1 files changed, 6 insertions, 18 deletions
diff --git a/buildstream/element.py b/buildstream/element.py index c805a844c..ce04f8163 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -2766,32 +2766,20 @@ class Element(Plugin): # Loads the public data from the cached artifact # def __load_public_data(self): - self.__assert_cached() assert self.__dynamic_public is None - # Load the public data from the artifact - artifact_vdir, _ = self.__get_artifact_directory() - meta_file = artifact_vdir._objpath(['meta', 'public.yaml']) - self.__dynamic_public = _yaml.load(meta_file, shortname='meta/public.yaml') + self.__dynamic_public = self.__artifact.load_public_data() def __load_build_result(self, keystrength): self.__assert_cached(keystrength=keystrength) assert self.__build_result is None - if keystrength is _KeyStrength.WEAK: - key = self.__weak_cache_key - else: - key = self.__strict_cache_key - - artifact_vdir, _ = self.__get_artifact_directory(key) - - if not artifact_vdir._exists(['meta', 'build-result.yaml']): - self.__build_result = (True, "succeeded", None) - return + # _get_cache_key with _KeyStrength.STRONG returns self.__cache_key, which can be `None` + # leading to a failed assertion from get_artifact_directory() using get_artifact_name(), + # so explicility pass self.__strict_cache_key + key = self.__weak_cache_key if keystrength is _KeyStrength.WEAK else self.__strict_cache_key - result_path = artifact_vdir._objpath(['meta', 'build-result.yaml']) - data = _yaml.load(result_path) - self.__build_result = (data["success"], data.get("description"), data.get("detail")) + self.__build_result = self.__artifact.load_build_result(key) def __get_build_result(self, keystrength): if keystrength is None: |