Add more helpful config parse error message
This commit is contained in:
parent
0076bcc83f
commit
0b31bab797
|
@ -95,7 +95,7 @@ try:
|
|||
# Set the config object in the api_provisioner namespace
|
||||
api_provisioner.config = config
|
||||
except Exception as e:
|
||||
print('ERROR: {}.'.format(e))
|
||||
print('ERROR: Failed to load configuration: {}'.format(e))
|
||||
exit(1)
|
||||
|
||||
# Create Flask app and set config values
|
||||
|
|
|
@ -166,7 +166,7 @@ def readConfig(pvcd_config_file, myhostname):
|
|||
'ipmi_password': o_config['pvc']['system']['fencing']['ipmi']['pass']
|
||||
}
|
||||
except Exception as e:
|
||||
print('ERROR: {}!'.format(e))
|
||||
print('ERROR: Failed to load configuration: {}'.format(e))
|
||||
exit(1)
|
||||
config = config_general
|
||||
|
||||
|
@ -217,7 +217,7 @@ def readConfig(pvcd_config_file, myhostname):
|
|||
'upstream_dev_ip': o_config['pvc']['system']['configuration']['networking']['upstream']['address'],
|
||||
}
|
||||
except Exception as e:
|
||||
print('ERROR: {}!'.format(e))
|
||||
print('ERROR: Failed to load configuration: {}'.format(e))
|
||||
exit(1)
|
||||
config = {**config, **config_networking}
|
||||
|
||||
|
@ -261,7 +261,7 @@ def readConfig(pvcd_config_file, myhostname):
|
|||
try:
|
||||
config_storage = dict()
|
||||
except Exception as e:
|
||||
print('ERROR: {}!'.format(e))
|
||||
print('ERROR: Failed to load configuration: {}'.format(e))
|
||||
exit(1)
|
||||
config = {**config, **config_storage}
|
||||
|
||||
|
|
Loading…
Reference in New Issue