diff options
author | Benjamin Schubert <contact@benschubert.me> | 2019-07-08 14:18:39 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | 099e3ebf3aad424be2f3488aef9d9d961b700483 (patch) | |
tree | b1634644122751537e092caf8c35f8a1cee6cf9b /src/buildstream/sandbox | |
parent | 695eddc069c9803eca5d004e80ca7be7defdd20c (diff) | |
download | buildstream-099e3ebf3aad424be2f3488aef9d9d961b700483.tar.gz |
_yaml: Remove 'node_get_provenance' and add 'Node.get_provenance'
This replaces the helper method by adding a 'get_provenance' on the node
directly
- Adapt all call sites
- Delay getting provenance wherever possible without major refactor
Diffstat (limited to 'src/buildstream/sandbox')
-rw-r--r-- | src/buildstream/sandbox/_sandboxremote.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/buildstream/sandbox/_sandboxremote.py b/src/buildstream/sandbox/_sandboxremote.py index ca3c5c3d9..76b1a6270 100644 --- a/src/buildstream/sandbox/_sandboxremote.py +++ b/src/buildstream/sandbox/_sandboxremote.py @@ -114,7 +114,7 @@ class SandboxRemote(Sandbox): def require_node(config, keyname): val = config.get_mapping(keyname, default=None) if val is None: - provenance = _yaml.node_get_provenance(remote_config, key=keyname) + provenance = remote_config.get_provenance() raise _yaml.LoadError(_yaml.LoadErrorReason.INVALID_DATA, "{}: '{}' was not present in the remote " "execution configuration (remote-execution). " @@ -146,7 +146,7 @@ class SandboxRemote(Sandbox): if 'execution-service' not in remote_config: exec_config = _yaml.Node.from_dict({'url': remote_config['url']}) else: - provenance = _yaml.node_get_provenance(remote_config, key='url') + provenance = remote_config.get_node('url').get_provenance() raise _yaml.LoadError(_yaml.LoadErrorReason.INVALID_DATA, "{}: 'url' and 'execution-service' keys were found in the remote " "execution configuration (remote-execution). " @@ -164,7 +164,7 @@ class SandboxRemote(Sandbox): for config_key, config in zip(service_keys, service_configs): # Either both or none of the TLS client key/cert pair must be specified: if ('client-key' in config) != ('client-cert' in config): - provenance = _yaml.node_get_provenance(remote_config, key=config_key) + provenance = remote_config.get_node(config_key).get_provenance() raise _yaml.LoadError(_yaml.LoadErrorReason.INVALID_DATA, "{}: TLS client key/cert pair is incomplete. " "You must specify both 'client-key' and 'client-cert' " |