summaryrefslogtreecommitdiff
path: root/src/buildstream/sandbox/_sandboxremote.py
diff options
context:
space:
mode:
authorTom Pollard <tom.pollard@codethink.co.uk>2019-07-17 15:48:06 +0100
committerbst-marge-bot <marge-bot@buildstream.build>2019-07-18 11:36:07 +0000
commite7524c4340523d06ba3d6d95cb1e284b0f4b415e (patch)
tree271d658e2fcdb7917dfca3c1270a4c3f31e80d76 /src/buildstream/sandbox/_sandboxremote.py
parentd79747d7ee2596a73f4ec68bd40bd2ca04427a93 (diff)
downloadbuildstream-e7524c4340523d06ba3d6d95cb1e284b0f4b415e.tar.gz
_exceptions.py: Align LoadError() parameter orderingtpollard/loaderror
All of the errors which subclass from BstError have their first positional argument as message, LoadError should follow this ordering for consistency.
Diffstat (limited to 'src/buildstream/sandbox/_sandboxremote.py')
-rw-r--r--src/buildstream/sandbox/_sandboxremote.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/buildstream/sandbox/_sandboxremote.py b/src/buildstream/sandbox/_sandboxremote.py
index 20298c1ce..c84bfa4ef 100644
--- a/src/buildstream/sandbox/_sandboxremote.py
+++ b/src/buildstream/sandbox/_sandboxremote.py
@@ -116,10 +116,10 @@ class SandboxRemote(Sandbox):
val = config.get_mapping(keyname, default=None)
if val is None:
provenance = remote_config.get_provenance()
- raise _yaml.LoadError(_yaml.LoadErrorReason.INVALID_DATA,
- "{}: '{}' was not present in the remote "
+ raise _yaml.LoadError("{}: '{}' was not present in the remote "
"execution configuration (remote-execution). "
- .format(str(provenance), keyname))
+ .format(str(provenance), keyname),
+ _yaml.LoadErrorReason.INVALID_DATA)
return val
remote_config = config_node.get_mapping('remote-execution', default=None)
@@ -148,11 +148,10 @@ class SandboxRemote(Sandbox):
exec_config = Node.from_dict({'url': remote_config['url']})
else:
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 "
+ raise _yaml.LoadError("{}: 'url' and 'execution-service' keys were found in the remote "
"execution configuration (remote-execution). "
"You can only specify one of these."
- .format(str(provenance)))
+ .format(str(provenance)), _yaml.LoadErrorReason.INVALID_DATA)
service_configs = [exec_config, storage_config, action_config]
@@ -166,11 +165,10 @@ class SandboxRemote(Sandbox):
# Either both or none of the TLS client key/cert pair must be specified:
if ('client-key' in config) != ('client-cert' in config):
provenance = remote_config.get_node(config_key).get_provenance()
- raise _yaml.LoadError(_yaml.LoadErrorReason.INVALID_DATA,
- "{}: TLS client key/cert pair is incomplete. "
+ raise _yaml.LoadError("{}: TLS client key/cert pair is incomplete. "
"You must specify both 'client-key' and 'client-cert' "
"for authenticated HTTPS connections."
- .format(str(provenance)))
+ .format(str(provenance)), _yaml.LoadErrorReason.INVALID_DATA)
for tls_key in tls_keys:
if tls_key in config: