Add more helpful config parse error message

This commit is contained in:
Joshua Boniface 2020-01-22 12:09:31 -05:00
parent 0076bcc83f
commit 0b31bab797
2 changed files with 4 additions and 4 deletions

View File

@ -95,7 +95,7 @@ try:
# Set the config object in the api_provisioner namespace # Set the config object in the api_provisioner namespace
api_provisioner.config = config api_provisioner.config = config
except Exception as e: except Exception as e:
print('ERROR: {}.'.format(e)) print('ERROR: Failed to load configuration: {}'.format(e))
exit(1) exit(1)
# Create Flask app and set config values # Create Flask app and set config values

View File

@ -166,7 +166,7 @@ def readConfig(pvcd_config_file, myhostname):
'ipmi_password': o_config['pvc']['system']['fencing']['ipmi']['pass'] 'ipmi_password': o_config['pvc']['system']['fencing']['ipmi']['pass']
} }
except Exception as e: except Exception as e:
print('ERROR: {}!'.format(e)) print('ERROR: Failed to load configuration: {}'.format(e))
exit(1) exit(1)
config = config_general config = config_general
@ -217,7 +217,7 @@ def readConfig(pvcd_config_file, myhostname):
'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['upstream']['address'], 'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['upstream']['address'],
} }
except Exception as e: except Exception as e:
print('ERROR: {}!'.format(e)) print('ERROR: Failed to load configuration: {}'.format(e))
exit(1) exit(1)
config = {**config, **config_networking} config = {**config, **config_networking}
@ -261,7 +261,7 @@ def readConfig(pvcd_config_file, myhostname):
try: try:
config_storage = dict() config_storage = dict()
except Exception as e: except Exception as e:
print('ERROR: {}!'.format(e)) print('ERROR: Failed to load configuration: {}'.format(e))
exit(1) exit(1)
config = {**config, **config_storage} config = {**config, **config_storage}