Skip to content
Snippets Groups Projects
Commit ba81a70c authored by Loraine Gueguen's avatar Loraine Gueguen
Browse files

Merge branch 'check_config_param' into 'dev'

Check required config param are not empty

See merge request !21
parents 23e250bb 49798701
No related branches found
No related tags found
2 merge requests!21Check required config param are not empty,!18Release v2.1.0
......@@ -54,3 +54,6 @@ DELETE_ORGANISMS_TOOL = "toolshed.g2.bx.psu.edu/repos/gga/chado_organism_delete_
HOST_DATA_DIR='src_data'
CONTAINER_DATA_DIR_ROOT='/project_data'
REQUIRED_PARAMETERS = [CONF_ALL_HOSTNAME, CONF_ALL_HTTP_PORT, CONF_GALAXY_DEFAULT_ADMIN_EMAIL, CONF_GALAXY_DEFAULT_ADMIN_USER,
CONF_GALAXY_DEFAULT_ADMIN_PASSWORD, CONF_TRIPAL_PASSWORD, CONF_GALAXY_CONFIG_REMOTE_USER_MAILDOMAIN]
......@@ -36,12 +36,16 @@ def parse_config(config_file):
"""
config_dict = load_yaml(config_file)
if isinstance(config_dict, dict):
#logging.debug("Config dictionary: {0}".format(config_dict))
return config_dict
else:
logging.critical("Config yaml file is not a dictionary" % config_file)
if not isinstance(config_dict, dict):
logging.critical("Config yaml file is not a dictionary (%s)" % config_file)
sys.exit()
else:
for required_parameter in constants.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