summaryrefslogtreecommitdiff
path: root/buildstream/_context.py
diff options
context:
space:
mode:
authorDaniel Silverstone <daniel.silverstone@codethink.co.uk>2019-03-25 15:08:37 +0000
committerDaniel Silverstone <daniel.silverstone@codethink.co.uk>2019-03-27 21:26:07 +0000
commit3816dcf8901b06f2b9c0153e5b5fe394acf104a5 (patch)
treee380f6c5386d97bc03707ccf8f20871b683e3b0b /buildstream/_context.py
parent1e698622caee2da202a2511bbf41f476224d4cb8 (diff)
downloadbuildstream-3816dcf8901b06f2b9c0153e5b5fe394acf104a5.tar.gz
The new YAML World Order
Replace YAML internals with a new Node type, and refactor everything to use it cleanly. This work was also by James Ennis <james.ennis@codethink.co.uk> Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
Diffstat (limited to 'buildstream/_context.py')
-rw-r--r--buildstream/_context.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/buildstream/_context.py b/buildstream/_context.py
index d14577842..afbf69726 100644
--- a/buildstream/_context.py
+++ b/buildstream/_context.py
@@ -157,7 +157,7 @@ class Context():
self._artifactcache = None
self._sourcecache = None
self._projects = []
- self._project_overrides = {}
+ self._project_overrides = _yaml.new_empty_node()
self._workspaces = None
self._workspace_project_cache = WorkspaceProjectCache()
self._log_handle = None
@@ -203,11 +203,11 @@ class Context():
_yaml.composite(defaults, user_config)
# Give obsoletion warnings
- if defaults.get('builddir'):
+ if _yaml.node_contains(defaults, 'builddir'):
raise LoadError(LoadErrorReason.INVALID_DATA,
"builddir is obsolete, use cachedir")
- if defaults.get('artifactdir'):
+ if _yaml.node_contains(defaults, 'artifactdir'):
raise LoadError(LoadErrorReason.INVALID_DATA,
"artifactdir is obsolete")
@@ -306,7 +306,7 @@ class Context():
self.sched_network_retries = _yaml.node_get(scheduler, int, 'network-retries')
# Load per-projects overrides
- self._project_overrides = _yaml.node_get(defaults, Mapping, 'projects', default_value={})
+ self._project_overrides = _yaml.node_get(defaults, dict, 'projects', default_value={})
# Shallow validation of overrides, parts of buildstream which rely
# on the overrides are expected to validate elsewhere.
@@ -441,7 +441,7 @@ class Context():
if self._cache_key is None:
# Anything that alters the build goes into the unique key
- self._cache_key = _cachekey.generate_key({})
+ self._cache_key = _cachekey.generate_key(_yaml.new_empty_node())
return self._cache_key