Skip to content
Snippets Groups Projects
Commit c55f9210 authored by Arthur Le Bars's avatar Arthur Le Bars
Browse files

Throw a critical error while parsing the supplied config file when a parameter...

Throw a critical error while parsing the supplied config file when a parameter is not configured or configured incorrectly (empty value) in the config file
parent e73b9d76
No related branches found
No related tags found
2 merge requests!21Check required config param are not empty,!18Release v2.1.0
This commit is part of merge request !21. Comments created here will be created in the context of that merge request.
......@@ -37,12 +37,17 @@ def parse_config(config_file):
config_dict = load_yaml(config_file)
if not isinstance(config_dict, dict):
logging.critical("Config yaml file is not a dictionary" % config_file)
logging.critical("Config yaml file is not a dictionary (%s)" % config_file)
sys.exit()
else:
#logging.debug("Config dictionary: {0}".format(config_dict))
#required_param = [constants.]
#check_not_empty_param()
required_parameters = [constants.CONF_ALL_HOSTNAME, constants.CONF_ALL_HTTP_PORT, constants.CONF_GALAXY_DEFAULT_ADMIN_EMAIL,
constants.CONF_GALAXY_DEFAULT_ADMIN_USER, constants.CONF_GALAXY_DEFAULT_ADMIN_PASSWORD, constants.CONF_TRIPAL_PASSWORD,
constants.CONF_GALAXY_CONFIG_REMOTE_USER_MAILDOMAIN]
for required_parameter in required_parameters:
if not config_dict[required_parameter]:
logging.critical("{0} parameter improperly configured in config file {1}".format(required_parameter, config_file))
sys.exit()
return config_dict
def parse_input(input_file):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment