diff options
author | Darius Makovsky <traveltissues@protonmail.com> | 2019-10-07 18:06:48 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-10-16 16:22:09 +0000 |
commit | cc2ee79c082884e03ccba7693afdaf1e05f43acc (patch) | |
tree | c044be0c398e329d1b944683bd57ebebbfc83faf /src | |
parent | f6e24e258e07403bf635710e17632beec2709b10 (diff) | |
download | buildstream-cc2ee79c082884e03ccba7693afdaf1e05f43acc.tar.gz |
workspace.py: raise AssertionError on init_workspace
Diffstat (limited to 'src')
-rw-r--r-- | src/buildstream/plugins/sources/workspace.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/buildstream/plugins/sources/workspace.py b/src/buildstream/plugins/sources/workspace.py index 8dbcc6218..9cc524f89 100644 --- a/src/buildstream/plugins/sources/workspace.py +++ b/src/buildstream/plugins/sources/workspace.py @@ -105,14 +105,11 @@ class WorkspaceSource(Source): self.__digest = self.__cas_dir._get_digest().hash return (self.path, self.__digest) + # init_workspace() + # + # Raises AssertionError: existing workspaces should not be reinitialized def init_workspace(self, directory: Directory) -> None: - # for each source held by the workspace we must call init_workspace - # those sources may override `init_workspace` expecting str or Directory - # and this will need to be extracted from the directory passed to this method - assert isinstance(directory, Directory) - directory = directory.external_directory - for source in self.get_element_sources(): - source._init_workspace(directory) + raise AssertionError('Attempting to re-open an existing workspace') def get_consistency(self): # always return cached state |