Fix "st2 pack install" command so we don't try to retrieve pack content
count when installing a local pack (pack name starting with "file://").
This way this command still works even if installation is behind proxy
which doesn't have access to index.stackstorm.org.
Resolves
@@ -200,10 +200,15 @@ class PackInstallCommand(PackAsyncCommand):
def _get_content_counts_for_pack(self, args, **kwargs):
# Global content list, excluding "tests"
+ # Note: We skip this step for local packs
pack_content = {'actions': 0, 'rules': 0, 'sensors': 0, 'aliases': 0, 'triggers': 0}
if len(args.packs) == 1:
args.pack = args.packs[0]
+
+ if args.pack.startswith('file://'):
+ return
+
pack_info = self.manager.search(args, **kwargs)
content = getattr(pack_info, 'content', {})
@@ -220,6 +225,10 @@ class PackInstallCommand(PackAsyncCommand):
for pack in args.packs:
# args.pack required for search
args.pack = pack
+
+ if args.pack.startswith('file://'):
+ return
+
pack_info = self.manager.search(args, **kwargs)
content = getattr(pack_info, 'content', {})
