From a5c9d914ae5befc32ab1f23ef8f90e2303f05311 Mon Sep 17 00:00:00 2001 From: Luik Date: Wed, 29 Jan 2025 13:16:16 +0100 Subject: [PATCH] Add /OMERO as a middle configuration path as well. Generally shared --- biomero/slurm_client.py | 4 +++- tests/unit/test_slurm_client.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/biomero/slurm_client.py b/biomero/slurm_client.py index 1931b2c..b1ebcf4 100644 --- a/biomero/slurm_client.py +++ b/biomero/slurm_client.py @@ -254,7 +254,8 @@ class SlurmClient(Connection): """ _DEFAULT_CONFIG_PATH_1 = "/etc/slurm-config.ini" - _DEFAULT_CONFIG_PATH_2 = "~/slurm-config.ini" + _DEFAULT_CONFIG_PATH_2 = "/OMERO/slurm-config.ini" + _DEFAULT_CONFIG_PATH_3 = "~/slurm-config.ini" _DEFAULT_HOST = "slurm" _DEFAULT_INLINE_SSH_ENV = True _DEFAULT_SLURM_DATA_PATH = "my-scratch/data" @@ -891,6 +892,7 @@ def from_config(cls, configfile: str = '', # Loads from default locations and given location, missing files are ok configs.read([os.path.expanduser(cls._DEFAULT_CONFIG_PATH_1), os.path.expanduser(cls._DEFAULT_CONFIG_PATH_2), + os.path.expanduser(cls._DEFAULT_CONFIG_PATH_3), os.path.expanduser(configfile)]) # Read the required parameters from the configuration file, diff --git a/tests/unit/test_slurm_client.py b/tests/unit/test_slurm_client.py index 6fd9eef..9e72072 100644 --- a/tests/unit/test_slurm_client.py +++ b/tests/unit/test_slurm_client.py @@ -1279,6 +1279,7 @@ def items_side_effect(section): mock_configparser_instance.read.assert_called_once_with([ os.path.expanduser(SlurmClient._DEFAULT_CONFIG_PATH_1), os.path.expanduser(SlurmClient._DEFAULT_CONFIG_PATH_2), + os.path.expanduser(SlurmClient._DEFAULT_CONFIG_PATH_3), os.path.expanduser(configfile) ]) mock_SlurmClient.assert_called_with(