Add support for installing multiple packs at once to "st2-pack-install"
CLI script.
@@ -42,7 +42,7 @@ def _do_register_cli_opts(opts, ignore_errors=False):
def _register_cli_opts():
cli_opts = [
- cfg.StrOpt('pack', default=None, required=True,
+ cfg.MultiStrOpt('pack', default=None, required=True, positional=True,
help='Name of the pack to install.'),
cfg.BoolOpt('verify-ssl', default=True,
help=('Verify SSL certificate of the Git repo from which the pack is '
@@ -94,13 +94,14 @@ def main(argv):
common_setup(config=config, setup_db=False, register_mq_exchanges=False,
register_internal_trigger_types=False)
- pack = cfg.CONF.pack
+ packs = cfg.CONF.pack
verify_ssl = cfg.CONF.verify_ssl
force = cfg.CONF.force
proxy_config = get_and_set_proxy_config()
- # 1. Download the pac
+ for pack in packs:
+ # 1. Download the pack
LOG.info('Installing pack "%s"' % (pack))
result = download_pack(pack=pack, verify_ssl=verify_ssl, force=force,
proxy_config=proxy_config, force_permissions=True)
@@ -120,3 +121,5 @@ def main(argv):
proxy_config=proxy_config, use_python3=False,
no_download=True)
LOG.info('Successfuly set up virtualenv for pack "%s"' % (pack))
+
+ return 0
