diff --git a/pyros.py b/pyros.py index 5435525..5e5abe2 100755 --- a/pyros.py +++ b/pyros.py @@ -871,7 +871,7 @@ def start(agent: str, configfile: str, observatory: str, unit: str, computer_hos path_to_obs_config_folder = default_obsconfig_folder+"pyros_observatory_"+observatory+"/" else: observatories_configuration_folder = os.path.join( - os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../PYROS_OBSERVATORY/") + os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../../PYROS_OBSERVATORY/") if len(glob.glob(observatories_configuration_folder+"pyros_observatory_"+observatory+"/")) != 1: # Observatory configuration folder not found print( @@ -1086,7 +1086,7 @@ def new_start(configfile: str, observatory: str, unit: str, computer_hostname: s path_to_obs_config_folder = default_obsconfig_folder+"pyros_observatory_"+observatory+"/" else: observatories_configuration_folder = os.path.join( - os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../PYROS_OBSERVATORY/") + os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../../PYROS_OBSERVATORY/") if len(glob.glob(observatories_configuration_folder+"pyros_observatory_"+observatory+"/")) != 1: # Observatory configuration folder not found print( @@ -1574,8 +1574,9 @@ def install_packages(): # @global_test_options @click.argument("observatory") def install_observatory(observatory): - if not os.path.exists("PYROS_OBSERVATORY"): - os.mkdir("PYROS_OBSERVATORY") + pyros_observatory_path = "../PYROS_OBSERVATORY" + if not os.path.exists(pyros_observatory_path): + os.mkdir(pyros_observatory_path) try: from git import Repo @@ -1593,14 +1594,13 @@ def install_observatory(observatory): from git import Repo else: log.error("GitPython package (required for obsconfig class) installation failed") - pyros_observatory_path = "PYROS_OBSERVATORY" print(os.path.join(pyros_observatory_path, f"pyros_observatory_{observatory}")) if os.path.exists(os.path.join(pyros_observatory_path, f"pyros_observatory_{observatory}")): print("Observatory already cloned") else: print("Cloning repository") cloned_repo = Repo.clone_from( - f"https://gitlab.irap.omp.eu/pyros-irap/pyros_observatory_{observatory}.git", "PYROS_OBSERVATORY") + f"https://gitlab.irap.omp.eu/pyros-irap/pyros_observatory_{observatory}.git", pyros_observatory_path) print("Cloned successfully: ", cloned_repo.__class__ is Repo) -- libgit2 0.21.2