Fixes for building TGZ labelfile and build actions
Change-Id: I62c2a930aa23c1d1d4bdac9d82b3e38370677ff4
Related-PROD: PROD-28199
diff --git a/cfg_checker/modules/packages/repos.py b/cfg_checker/modules/packages/repos.py
index 27c388c..00c438f 100644
--- a/cfg_checker/modules/packages/repos.py
+++ b/cfg_checker/modules/packages/repos.py
@@ -736,12 +736,7 @@
def _build_action(self, url, tags):
for t in tags:
- logger_cli.info(
- "# Building repo info for '{}/{}'".format(
- url,
- t
- )
- )
+ logger_cli.info("# Building repo info for '{}'".format(t))
self.build_repos(url, tag=t)
def get_available_tags(self, tag=None):
@@ -773,20 +768,28 @@
# See if this is a list action
if action == "list":
_all = ReposInfo().list_tags()
- # Print pretty list and exit
- logger_cli.info("# Tags available at '{}':".format(url))
- for t in _all:
- _ri = self._repo_index
- _isparsed = any(
- [k for k, v in _ri.iteritems() if v['props']['tag'] == t]
- )
- if _isparsed:
- logger_cli.info(get_tag_label(t, parsed=True))
- else:
- logger_cli.info(get_tag_label(t))
+ if _all:
+ # Print pretty list and exit
+ logger_cli.info("# Tags available at '{}':".format(url))
+ for t in _all:
+ _ri = self._repo_index
+ _isparsed = any(
+ [k for k, v in _ri.iteritems()
+ if v['props']['tag'] == t]
+ )
+ if _isparsed:
+ logger_cli.info(get_tag_label(t, parsed=True))
+ else:
+ logger_cli.info(get_tag_label(t))
+ else:
+ logger_cli.info("# Not tags parsed yet for '{}':".format(url))
+
# exit
return
+ if action == "build":
+ self._build_action(url, [tag])
+
# Populate action tags
_action_tags = self.get_available_tags(tag)
@@ -802,9 +805,7 @@
)
)
# Execute actions
- if action == "build":
- self._build_action(url, _action_tags)
- elif action == "fetch":
+ if action == "fetch":
for t in _action_tags:
self.fetch_versions(t, descriptions=descriptions, apps=apps)