Skip to content
Snippets Groups Projects
Commit 5606fc90 authored by Anne Tipka's avatar Anne Tipka :headphones:
Browse files

included checking for Bologna vs Reading servers and adapted queue and host names

parent 5adaf8a5
Branches
No related tags found
No related merge requests found
......@@ -452,7 +452,7 @@ def check_mail(mail):
def check_queue(queue, gateway, destination, ecuid, ecgid):
'''Check if the necessary ECMWF parameters are set if the queue is
one of the QUEUES_LIST (in _config).
one of the QUEUES_LIST_ALL (in _config).
Parameters
----------
......@@ -478,13 +478,13 @@ def check_queue(queue, gateway, destination, ecuid, ecgid):
------
'''
if queue in _config.QUEUES_LIST and \
if queue in _config.QUEUES_LIST_ALL and \
(not ecuid or not ecgid):
raise ValueError('\nEnvironment variables ECUID '
'and ECGID were not set properly! \n '
'Please check for existence of file "ECMWF_ENV" '
'in the run directory!')
elif queue in _config.QUEUES_LIST and \
elif queue in _config.QUEUES_LIST_ALL and \
(not gateway or not destination):
print('WARNING: Parameters GATEWAY and DESTINATION were '
'not properly set for working on ECMWF server. \n'
......
......@@ -42,11 +42,34 @@ import platform
# PARAMETERS
# ------------------------------------------------------------------------------
_VERSION_STR = '7.1.2_ctbto'
FLAG_ON_ECMWFSERVER = 'ecgb' in platform.node()
_VERSION_STR = '7.1.3'
HOSTNAMES_BOLOGNA_LIST = ['ecs', 'aa', 'ab', 'ac', 'ad']
HOSTNAMES_READING_LIST = ['ecgb', 'cca', 'ccb']
# name of environment variable on ECMWF Bologna servers
# that indicates which cluster / host we are on
HOSTENV_BOLOGNA = 'EC_CLUSTER'
# name of environment variable on ECMWF Reading servers
# that indicates which cluster / host we are on
HOSTENV_READING = 'ECPLATFORM'
# test if we are on a Bologna or Reading server
# Test and set ECMWF Bologna server values
if os.getenv(HOSTENV_BOLOGNA) is not None:
ec_hostname = os.getenv(HOSTENV_BOLOGNA)
FLAG_ON_ECMWFSERVER = ec_hostname in HOSTNAMES_BOLOGNA_LIST
QUEUES_LIST = ['ecs', 'ecs-login', 'hpc', 'hpc-login', 'hpc-2020']
# Test and set ECMWF Reading server values
elif os.getenv(HOSTENV_READING) is not None:
ec_hostname = os.getenv(HOSTENV_READING)
FLAG_ON_ECMWFSERVER = ec_hostname in HOSTNAMES_READING_LIST
QUEUES_LIST = ['ecgate', 'cca', 'ccb']
else:
FLAG_ON_ECMWFSERVER = False
QUEUES_LIST_ALL = ['ecs', 'ecs-login', 'hpc', 'hpc-login', 'hpc-2020', 'ecgate', 'cca', 'ccb']
INSTALL_TARGETS = ['local', 'syslocal', 'ecgate', 'cca', 'ccb']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment