summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Bartosh <eduard.bartosh@intel.com>2013-08-19 18:40:55 +0300
committerEduard Bartosh <eduard.bartosh@intel.com>2013-08-19 09:28:47 -0700
commitcce1e2e73992ede7d58fa02158016021aa23c2ac (patch)
tree1e2f11b40f7053bea68a585415ea01c3fdd2f62a
parentc3bf525c9af00c9d7154d761ca391d3a9c709a1e (diff)
downloadrepa-cce1e2e73992ede7d58fa02158016021aa23c2ac.tar.gz
repa-cce1e2e73992ede7d58fa02158016021aa23c2ac.tar.bz2
repa-cce1e2e73992ede7d58fa02158016021aa23c2ac.zip
Extended repa list output
Added more information to the repa list output. - list of projects for the submissions - list of images for the submissions and groups Change-Id: I468fe0124cfa9f32dc9871ee1d847bf3d829145e Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com> Reviewed-on: https://otctools.jf.intel.com/review/5993 Tested-by: OTC Tools Tester <ed.bartosh@linux.intel.com>
-rwxr-xr-xrepa/list.py43
1 files changed, 22 insertions, 21 deletions
diff --git a/repa/list.py b/repa/list.py
index 2af2ec2..6ff71ae 100755
--- a/repa/list.py
+++ b/repa/list.py
@@ -28,35 +28,36 @@ def get_status(obs, project):
for pkginfo in target['packages']:
codes.add(pkginfo[1])
status = ','.join(codes) or 'None'
- return 'packages: ' + status
+ return status
+def show_images(meta):
+ if 'images' in meta:
+ print ' images:', ','.join("%s:%s" % (img['name'], img['status']) \
+ for img in meta['images'])
+
def list_submissions(obs, regexp):
"""List submissions and groups."""
# submissions
- submissions = set()
- header = True
+ groups = []
for project, desc in obs.get_projects('^%s.*%s' % (OBS_PREFIX, regexp)):
+ meta = json.loads(desc)
if ':submitgroup:' in project:
+ groups.append(meta)
continue
- meta = json.loads(desc)
- submissions.add(meta['git_tag'])
- if header:
- print ':::: Submissions:'
- header = False
- print meta['git_tag'], meta['obs_target_prj'], \
- get_status(obs, project)
-
- # Groups, related to selected submissions
- header = True
- for project, desc in obs.get_projects('^%ssubmitgroup' % OBS_PREFIX):
- meta = json.loads(desc)
- lsub = set(meta['submissions'])
- if lsub.intersection(submissions):
- if header:
- print ':::: Groups:'
- header = False
- print meta['name'], ','.join(subm.split('/')[-1] for subm in lsub)
+ print meta['git_tag'], meta['obs_target_prj'],
+ print ' projects: ', ' '.join(meta['projects'])
+ print " builds:", get_status(obs, project)
+ show_images(meta)
+ print
+
+ # groups
+ for meta in groups:
+ print meta['name']
+ print ' submissions:', ' '.join(subm.split('/')[-1] \
+ for subm in meta['submissions'])
+ show_images(meta)
+ print
class List(object):