From 48476f39ca6e9470103adf373dda0cb5426e585b Mon Sep 17 00:00:00 2001 From: Alexis Koralewski Date: Fri, 15 Sep 2023 14:19:51 +0200 Subject: [PATCH] fix observatory file not found --- pyros.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyros.py b/pyros.py index 59f3bce..680c8c7 100755 --- a/pyros.py +++ b/pyros.py @@ -842,8 +842,7 @@ def install_dependencies(observatory: str, unit: str, foreground: bool): path_to_obs_config_folder = observatories_configuration_folder+"pyros_observatory_"+observatory obs_config_file_name = "" # Search for observatory config file - obs_config_file_name = glob.glob( - path_to_obs_config_folder+"/observatory*.yml")[0] + obs_config_file_name = glob.glob(os.path.join(path_to_obs_config_folder, "observatory.yml"))[0] obs_config_file_path = os.path.join( path_to_obs_config_folder, obs_config_file_name) @@ -962,8 +961,7 @@ def start(agent: str, configfile: str, observatory: str, unit: str, computer_hos path_to_obs_config_folder = observatories_configuration_folder+"pyros_observatory_"+observatory obs_config_file_name = "" # Search for observatory config file - obs_config_file_name = glob.glob( - path_to_obs_config_folder+"/observatory*.yml")[0] + obs_config_file_name = glob.glob(os.path.join(path_to_obs_config_folder, "observatory.yml"))[0] obs_config_file_path = os.path.join( path_to_obs_config_folder, obs_config_file_name) @@ -1141,6 +1139,7 @@ def new_start(configfile: str, observatory: str, unit: str, computer_hostname: s "pykwalify package (required for obsconfig class) installation failed") if configfile: log.debug("With config file" + configfile) + # Verif if file exists os.environ["pyros_config_file"] = os.path.join(os.path.abspath( PYROS_DJANGO_BASE_DIR), "../../../config/", configfile) else: @@ -1177,8 +1176,7 @@ def new_start(configfile: str, observatory: str, unit: str, computer_hostname: s path_to_obs_config_folder = observatories_configuration_folder+"pyros_observatory_"+observatory obs_config_file_name = "" # Search for observatory config file - obs_config_file_name = glob.glob( - path_to_obs_config_folder+"observatory*.yml")[0] + obs_config_file_name = glob.glob(os.path.join(path_to_obs_config_folder, "observatory.yml"))[0] obs_config_file_path = os.path.join( path_to_obs_config_folder, obs_config_file_name) -- libgit2 0.21.2