diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-01 20:26:50 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2017-10-01 20:26:50 +0900 |
commit | cced3006a39fd8be6e4fa926e68666c672db3d6d (patch) | |
tree | 921dfa1ee686d25de288054bdcfa44c70ec0bcff /buildstream/_variables.py | |
parent | 2d664a9a47c55f5adb8f7d9694fc4198067411ea (diff) | |
download | buildstream-cced3006a39fd8be6e4fa926e68666c672db3d6d.tar.gz |
Use _yaml.node_items() across the board, instead of casing _yaml.PROVENANCE_KEY
Consequently improved _yaml.node_sanitize() to omit a crazy lambda
which had no effect at all on the outcome of the function.
Diffstat (limited to 'buildstream/_variables.py')
-rw-r--r-- | buildstream/_variables.py | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/buildstream/_variables.py b/buildstream/_variables.py index 6d417f6f0..dfbd8ff04 100644 --- a/buildstream/_variables.py +++ b/buildstream/_variables.py @@ -125,9 +125,8 @@ class Variables(): def resolve_one(variables): unmatched = [] resolved = {} - for key, value in variables.items(): - if key == _yaml.PROVENANCE_KEY: - continue + + for key, value in _yaml.node_items(variables): # Ensure stringness of the value before substitution value = _yaml.node_get(variables, str, key) @@ -170,10 +169,7 @@ class Variables(): # def find_references(self, varname): fullname = '%{' + varname + '}' - for key, value in self.original.items(): - if key == _yaml.PROVENANCE_KEY: - continue - + for key, value in _yaml.node_items(self.original): if fullname in value: provenance = _yaml.node_get_provenance(self.original, key) yield (key, provenance) |