diff options
author | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-04-09 13:39:12 +0100 |
---|---|---|
committer | Tom Pollard <tom.pollard@codethink.co.uk> | 2019-04-17 15:56:38 +0100 |
commit | 5c7b90ba845a5053fb915425927ec9157761a6cd (patch) | |
tree | 54fa9d215a5f13b357c530c92e40afd98078e9ca | |
parent | 30ba63223172d1888864377674ce5b214777e61b (diff) | |
download | buildstream-5c7b90ba845a5053fb915425927ec9157761a6cd.tar.gz |
element.py: Assert cached in __load_public_data()
This moves the cached assertion to happen before calling the
Artifact method, which removes the need to loopback for the
same purpose.
-rw-r--r-- | buildstream/_artifact.py | 3 | ||||
-rw-r--r-- | buildstream/element.py | 1 |
2 files changed, 1 insertions, 3 deletions
diff --git a/buildstream/_artifact.py b/buildstream/_artifact.py index 7ff066407..0eb198387 100644 --- a/buildstream/_artifact.py +++ b/buildstream/_artifact.py @@ -245,9 +245,6 @@ class Artifact(): # def load_public_data(self): - element = self._element - assert element._cached() - # Load the public data from the artifact meta_vdir, _ = self._get_subdirectory('meta') meta_file = meta_vdir._objpath('public.yaml') diff --git a/buildstream/element.py b/buildstream/element.py index bc8f25cf8..7fb771697 100644 --- a/buildstream/element.py +++ b/buildstream/element.py @@ -2876,6 +2876,7 @@ 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 self.__dynamic_public = self.__artifact.load_public_data() |