Commit 48476f39ca6e9470103adf373dda0cb5426e585b
1 parent
d3e71677
Exists in
dev
fix observatory file not found
Showing
1 changed file
with
4 additions
and
6 deletions
Show diff stats
pyros.py
... | ... | @@ -842,8 +842,7 @@ def install_dependencies(observatory: str, unit: str, foreground: bool): |
842 | 842 | path_to_obs_config_folder = observatories_configuration_folder+"pyros_observatory_"+observatory |
843 | 843 | obs_config_file_name = "" |
844 | 844 | # Search for observatory config file |
845 | - obs_config_file_name = glob.glob( | |
846 | - path_to_obs_config_folder+"/observatory*.yml")[0] | |
845 | + obs_config_file_name = glob.glob(os.path.join(path_to_obs_config_folder, "observatory.yml"))[0] | |
847 | 846 | |
848 | 847 | obs_config_file_path = os.path.join( |
849 | 848 | 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 |
962 | 961 | path_to_obs_config_folder = observatories_configuration_folder+"pyros_observatory_"+observatory |
963 | 962 | obs_config_file_name = "" |
964 | 963 | # Search for observatory config file |
965 | - obs_config_file_name = glob.glob( | |
966 | - path_to_obs_config_folder+"/observatory*.yml")[0] | |
964 | + obs_config_file_name = glob.glob(os.path.join(path_to_obs_config_folder, "observatory.yml"))[0] | |
967 | 965 | |
968 | 966 | obs_config_file_path = os.path.join( |
969 | 967 | 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 |
1141 | 1139 | "pykwalify package (required for obsconfig class) installation failed") |
1142 | 1140 | if configfile: |
1143 | 1141 | log.debug("With config file" + configfile) |
1142 | + # Verif if file exists | |
1144 | 1143 | os.environ["pyros_config_file"] = os.path.join(os.path.abspath( |
1145 | 1144 | PYROS_DJANGO_BASE_DIR), "../../../config/", configfile) |
1146 | 1145 | else: |
... | ... | @@ -1177,8 +1176,7 @@ def new_start(configfile: str, observatory: str, unit: str, computer_hostname: s |
1177 | 1176 | path_to_obs_config_folder = observatories_configuration_folder+"pyros_observatory_"+observatory |
1178 | 1177 | obs_config_file_name = "" |
1179 | 1178 | # Search for observatory config file |
1180 | - obs_config_file_name = glob.glob( | |
1181 | - path_to_obs_config_folder+"observatory*.yml")[0] | |
1179 | + obs_config_file_name = glob.glob(os.path.join(path_to_obs_config_folder, "observatory.yml"))[0] | |
1182 | 1180 | |
1183 | 1181 | obs_config_file_path = os.path.join( |
1184 | 1182 | path_to_obs_config_folder, obs_config_file_name) | ... | ... |