add a --use-python3 flag to the install_pack command to allow st2-pack-install to specify whether to use python3 for the setup of the virtualenv during a pack install
@@ -42,6 +42,9 @@ def _register_cli_opts():
cfg.BoolOpt('force', default=False,
help='True to force pack installation and ignore install '
'lock file if it exists.'),
+ cfg.BoolOpt('use-python3', default=False,
+ help='True to use Python3 binary when creating virtualenv '
+ 'for this pack.'),
]
do_register_cli_opts(cli_opts)
@@ -56,6 +59,7 @@ def main(argv):
packs = cfg.CONF.pack
verify_ssl = cfg.CONF.verify_ssl
force = cfg.CONF.force
+ use_python3 = cfg.CONF.use_python3
proxy_config = get_and_set_proxy_config()
@@ -79,7 +83,7 @@ def main(argv):
# 2. Setup pack virtual environment
LOG.info('Setting up virtualenv for pack "%s"' % (pack_name))
setup_pack_virtualenv(pack_name=pack_name, update=False, logger=LOG,
- proxy_config=proxy_config, use_python3=False,
+ proxy_config=proxy_config, use_python3=use_python3,
no_download=True)
LOG.info('Successfully set up virtualenv for pack "%s"' % (pack_name))
