... |
... |
@@ -49,22 +49,27 @@ def start(context, config): |
49
|
49
|
with open(config) as f:
|
50
|
50
|
settings = parser.get_parser().safe_load(f)
|
51
|
51
|
|
52
|
|
- server_settings = settings['server']
|
53
|
|
- insecure_mode = server_settings['insecure-mode']
|
54
|
|
-
|
55
|
|
- credentials = None
|
56
|
|
- if not insecure_mode:
|
57
|
|
- server_key = server_settings['tls-server-key']
|
58
|
|
- server_cert = server_settings['tls-server-cert']
|
59
|
|
- client_certs = server_settings['tls-client-certs']
|
60
|
|
- credentials = context.load_server_credentials(server_key, server_cert, client_certs)
|
61
|
|
-
|
62
|
|
- if not credentials:
|
63
|
|
- click.echo("ERROR: no TLS keys were specified and no defaults could be found.\n" +
|
64
|
|
- "Set `insecure-mode: false` in order to deactivate TLS encryption.\n", err=True)
|
65
|
|
- sys.exit(-1)
|
66
|
|
-
|
67
|
|
- instances = settings['instances']
|
|
52
|
+ try:
|
|
53
|
+ server_settings = settings['server']
|
|
54
|
+ insecure_mode = server_settings['insecure-mode']
|
|
55
|
+
|
|
56
|
+ credentials = None
|
|
57
|
+ if not insecure_mode:
|
|
58
|
+ server_key = server_settings['tls-server-key']
|
|
59
|
+ server_cert = server_settings['tls-server-cert']
|
|
60
|
+ client_certs = server_settings['tls-client-certs']
|
|
61
|
+ credentials = context.load_server_credentials(server_key, server_cert, client_certs)
|
|
62
|
+
|
|
63
|
+ if not credentials:
|
|
64
|
+ click.echo("ERROR: no TLS keys were specified and no defaults could be found.\n" +
|
|
65
|
+ "Set `insecure-mode: false` in order to deactivate TLS encryption.\n", err=True)
|
|
66
|
+ sys.exit(-1)
|
|
67
|
+
|
|
68
|
+ instances = settings['instances']
|
|
69
|
+
|
|
70
|
+ except KeyError as e:
|
|
71
|
+ click.echo("ERROR: Could not parse config: {}.\n".format(str(e)), err=True)
|
|
72
|
+ sys.exit(-1)
|
68
|
73
|
|
69
|
74
|
execution_controllers = _instance_maker(instances, ExecutionController)
|
70
|
75
|
|