diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-02 18:03:33 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-02 18:03:33 +0900 |
commit | 3a0db8e0b45426c901b0967ae37f9c15a186ba6e (patch) | |
tree | 15cd75b080901752f4457b9bef5f770f4d9560c3 | |
parent | cced3006a39fd8be6e4fa926e68666c672db3d6d (diff) | |
download | buildstream-3a0db8e0b45426c901b0967ae37f9c15a186ba6e.tar.gz |
context.py: Make _get_overrides() take a project name, not a project.
This is merely a protection against crossing the project/context
wires together. The Project will gain knowledge of the context soon,
so it's better that the context itself remain without any knowledge
of the context.
-rw-r--r-- | buildstream/_artifactcache/artifactcache.py | 2 | ||||
-rw-r--r-- | buildstream/context.py | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/buildstream/_artifactcache/artifactcache.py b/buildstream/_artifactcache/artifactcache.py index d91a93738..fc59c48a4 100644 --- a/buildstream/_artifactcache/artifactcache.py +++ b/buildstream/_artifactcache/artifactcache.py @@ -42,7 +42,7 @@ class ArtifactCache(): self._pull_local = False self._push_local = False - project_overrides = context._get_overrides(project) + project_overrides = context._get_overrides(project.name) artifact_overrides = _yaml.node_get(project_overrides, Mapping, 'artifacts', default_value={}) override_pull = _yaml.node_get(artifact_overrides, str, 'pull-url', default_value='') or None override_push = _yaml.node_get(artifact_overrides, str, 'push-url', default_value='') or None diff --git a/buildstream/context.py b/buildstream/context.py index d271e06d5..9a745cb7c 100644 --- a/buildstream/context.py +++ b/buildstream/context.py @@ -241,13 +241,13 @@ class Context(): # node should be loaded using the _yaml.node_get() family of functions. # # Args: - # project: The Project + # project_name (str): The project name # # Returns: # (Mapping): The overrides dictionary for the specified project # - def _get_overrides(self, project): - return _yaml.node_get(self._project_overrides, Mapping, project.name, default_value={}) + def _get_overrides(self, project_name): + return _yaml.node_get(self._project_overrides, Mapping, project_name, default_value={}) # _get_cache_key(): # |