Commit 33699154e0334e3e2a768464ba6a05b1b3cc14c8
1 parent
56530eb3
Exists in
dev
Fix install_observatory path
Showing
1 changed file
with
6 additions
and
6 deletions
Show diff stats
pyros.py
@@ -871,7 +871,7 @@ def start(agent: str, configfile: str, observatory: str, unit: str, computer_hos | @@ -871,7 +871,7 @@ def start(agent: str, configfile: str, observatory: str, unit: str, computer_hos | ||
871 | path_to_obs_config_folder = default_obsconfig_folder+"pyros_observatory_"+observatory+"/" | 871 | path_to_obs_config_folder = default_obsconfig_folder+"pyros_observatory_"+observatory+"/" |
872 | else: | 872 | else: |
873 | observatories_configuration_folder = os.path.join( | 873 | observatories_configuration_folder = os.path.join( |
874 | - os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../PYROS_OBSERVATORY/") | 874 | + os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../../PYROS_OBSERVATORY/") |
875 | if len(glob.glob(observatories_configuration_folder+"pyros_observatory_"+observatory+"/")) != 1: | 875 | if len(glob.glob(observatories_configuration_folder+"pyros_observatory_"+observatory+"/")) != 1: |
876 | # Observatory configuration folder not found | 876 | # Observatory configuration folder not found |
877 | print( | 877 | print( |
@@ -1086,7 +1086,7 @@ def new_start(configfile: str, observatory: str, unit: str, computer_hostname: s | @@ -1086,7 +1086,7 @@ def new_start(configfile: str, observatory: str, unit: str, computer_hostname: s | ||
1086 | path_to_obs_config_folder = default_obsconfig_folder+"pyros_observatory_"+observatory+"/" | 1086 | path_to_obs_config_folder = default_obsconfig_folder+"pyros_observatory_"+observatory+"/" |
1087 | else: | 1087 | else: |
1088 | observatories_configuration_folder = os.path.join( | 1088 | observatories_configuration_folder = os.path.join( |
1089 | - os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../PYROS_OBSERVATORY/") | 1089 | + os.path.abspath(PYROS_DJANGO_BASE_DIR), "../../../../PYROS_OBSERVATORY/") |
1090 | if len(glob.glob(observatories_configuration_folder+"pyros_observatory_"+observatory+"/")) != 1: | 1090 | if len(glob.glob(observatories_configuration_folder+"pyros_observatory_"+observatory+"/")) != 1: |
1091 | # Observatory configuration folder not found | 1091 | # Observatory configuration folder not found |
1092 | print( | 1092 | print( |
@@ -1574,8 +1574,9 @@ def install_packages(): | @@ -1574,8 +1574,9 @@ def install_packages(): | ||
1574 | # @global_test_options | 1574 | # @global_test_options |
1575 | @click.argument("observatory") | 1575 | @click.argument("observatory") |
1576 | def install_observatory(observatory): | 1576 | def install_observatory(observatory): |
1577 | - if not os.path.exists("PYROS_OBSERVATORY"): | ||
1578 | - os.mkdir("PYROS_OBSERVATORY") | 1577 | + pyros_observatory_path = "../PYROS_OBSERVATORY" |
1578 | + if not os.path.exists(pyros_observatory_path): | ||
1579 | + os.mkdir(pyros_observatory_path) | ||
1579 | 1580 | ||
1580 | try: | 1581 | try: |
1581 | from git import Repo | 1582 | from git import Repo |
@@ -1593,14 +1594,13 @@ def install_observatory(observatory): | @@ -1593,14 +1594,13 @@ def install_observatory(observatory): | ||
1593 | from git import Repo | 1594 | from git import Repo |
1594 | else: | 1595 | else: |
1595 | log.error("GitPython package (required for obsconfig class) installation failed") | 1596 | log.error("GitPython package (required for obsconfig class) installation failed") |
1596 | - pyros_observatory_path = "PYROS_OBSERVATORY" | ||
1597 | print(os.path.join(pyros_observatory_path, f"pyros_observatory_{observatory}")) | 1597 | print(os.path.join(pyros_observatory_path, f"pyros_observatory_{observatory}")) |
1598 | if os.path.exists(os.path.join(pyros_observatory_path, f"pyros_observatory_{observatory}")): | 1598 | if os.path.exists(os.path.join(pyros_observatory_path, f"pyros_observatory_{observatory}")): |
1599 | print("Observatory already cloned") | 1599 | print("Observatory already cloned") |
1600 | else: | 1600 | else: |
1601 | print("Cloning repository") | 1601 | print("Cloning repository") |
1602 | cloned_repo = Repo.clone_from( | 1602 | cloned_repo = Repo.clone_from( |
1603 | - f"https://gitlab.irap.omp.eu/pyros-irap/pyros_observatory_{observatory}.git", "PYROS_OBSERVATORY") | 1603 | + f"https://gitlab.irap.omp.eu/pyros-irap/pyros_observatory_{observatory}.git", pyros_observatory_path) |
1604 | print("Cloned successfully: ", cloned_repo.__class__ is Repo) | 1604 | print("Cloned successfully: ", cloned_repo.__class__ is Repo) |
1605 | 1605 | ||
1606 | 1606 |