From 8432d11b193a3d414e6335436914ff1e4d43968f Mon Sep 17 00:00:00 2001
From: Arthur Le Bars <arthur.le-bars@sb-roscoff.fr>
Date: Tue, 25 May 2021 14:05:54 +0200
Subject: [PATCH] REQUIRED_PARAMETERS variable added to constants.py

---
 constants.py | 3 +++
 utilities.py | 5 +----
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/constants.py b/constants.py
index 0eada7f..40d76b5 100644
--- a/constants.py
+++ b/constants.py
@@ -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]
diff --git a/utilities.py b/utilities.py
index ff24356..c6e7cfb 100755
--- a/utilities.py
+++ b/utilities.py
@@ -40,10 +40,7 @@ def parse_config(config_file):
         logging.critical("Config yaml file is not a dictionary (%s)" % config_file)
         sys.exit()
     else:
-        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:
+        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()
-- 
GitLab