summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/http-api.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/conf_mode/http-api.py b/src/conf_mode/http-api.py
index 2ade3476d..dc75e79b7 100755
--- a/src/conf_mode/http-api.py
+++ b/src/conf_mode/http-api.py
@@ -94,15 +94,18 @@ def get_config(config=None):
key = conf.return_value('keys id {0} key'.format(name))
new_key = { 'id': name, 'key': key }
http_api['api_keys'].append(new_key)
- keys_added = True
-
- if keys_added and default_key:
- if default_key in http_api['api_keys']:
- http_api['api_keys'].remove(default_key)
+ else:
+ raise ConfigError(f'Missing HTTPS API key string for key id "{name}"')
return http_api
def verify(http_api):
+ # Verify API server settings, if present
+ keys = http_api['api_keys']
+
+ if not keys:
+ raise ConfigError('At least one HTTPS API key is required')
+
return None
def generate(http_api):