From 9ceeb7f09bbc81648382283e2359ed40a27d530c Mon Sep 17 00:00:00 2001 From: jk464 Date: Thu, 17 Aug 2023 13:16:53 +0100 Subject: [PATCH] fixup! Added get-dependencies option to install_pack.py --- st2common/st2common/cmd/install_pack.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/st2common/st2common/cmd/install_pack.py b/st2common/st2common/cmd/install_pack.py index 179eba137e4..69419586ea7 100644 --- a/st2common/st2common/cmd/install_pack.py +++ b/st2common/st2common/cmd/install_pack.py @@ -26,7 +26,7 @@ from st2common.util.pack_management import download_pack from st2common.util.pack_management import get_and_set_proxy_config from st2common.util.virtualenvs import setup_pack_virtualenv -from st2common.content.utils import get_pack_base_path +from st2common.content.utils import get_pack_base_path, get_packs_base_paths __all__ = ["main"] @@ -71,17 +71,19 @@ def get_pack_dependencies(pack, verify_ssl, force, dependencies, proxy_config): try: pack_metadata = get_pack_metadata(pack_dir=pack_path) result = pack_metadata.get("dependencies", None) - except Exception: - LOG.error("Could not open pack.yaml at location %s" % pack_path) - result = None - finally: if result: LOG.info('Getting pack dependencies for pack "%s"' % (pack)) download_packs(result, verify_ssl, force, dependencies, proxy_config) LOG.info('Successfully got pack dependencies for pack "%s"' % (pack)) + except IOError: + LOG.error("Could not open pack.yaml at location %s" % pack_path) + result = None def download_packs(packs, verify_ssl, force, dependencies, proxy_config): + packs_base_paths = get_packs_base_paths() + LOG.info(packs_base_paths) + for pack in packs: if pack in listdir("/opt/stackstorm/packs"): LOG.info('Pack already installed "%s"' % (pack))