Skip to content

Commit

Permalink
fixup! Added get-dependencies option to install_pack.py
Browse files Browse the repository at this point in the history
  • Loading branch information
jk464 committed Aug 17, 2023
1 parent edcaec2 commit 9ceeb7f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions st2common/st2common/cmd/install_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 9ceeb7f

Please sign in to comment.