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
|
# 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
|
||||||
|
|
|
@ -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}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue