summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonghee Han <onstudy@samsung.com>2017-07-11 09:54:05 +0900
committerYonghee Han <onstudy@samsung.com>2017-07-11 09:54:05 +0900
commite1b724b754d5b9a6715afa8e21a590165c8717a3 (patch)
tree3cbfba1925dd47a6b7c530b4137530035c34fd82
parent7b45d84366e10a5d85f40e7ff031ce1c10505277 (diff)
downloadrepa-e1b724b754d5b9a6715afa8e21a590165c8717a3.tar.gz
repa-e1b724b754d5b9a6715afa8e21a590165c8717a3.tar.bz2
repa-e1b724b754d5b9a6715afa8e21a590165c8717a3.zip
DXLTTC-761 Add argument of repa list
Show submission reference project in project : --refprj Change-Id: Ia3a9a838b1b525fe8ff3cd92545a7ed38735eab7
-rwxr-xr-xrepa/list.py43
1 files changed, 31 insertions, 12 deletions
diff --git a/repa/list.py b/repa/list.py
index 0e0251b..d92e4fa 100755
--- a/repa/list.py
+++ b/repa/list.py
@@ -106,7 +106,7 @@ def get_sr(obs, project, package, tag, status):
return sreq[0]
def list_submissions(obs, target, processes, base, is_colorize=False,
- showurls=False, ignore='', showtime=False):
+ showurls=False, ignore='', showtime=False, refprj=False):
"""List submissions and groups."""
colorizer = Colorizer(is_colorize)
# submissions
@@ -136,17 +136,33 @@ def list_submissions(obs, target, processes, base, is_colorize=False,
rsr = get_sr(obs, base, projects[0], tag, 'revoked')
if rsr:
base_status = colorizer.red('rejected. SR %s' % rsr)
- print '%-37s %-37s %-37s %s' % \
- (meta['git_tag'],
- get_status(meta, colorizer, build_results,
- ignore, obs, showtime),
- base_status, ','.join(projects))
+ if refprj:
+ print '%-37s %-37s %-37s %-37s %s' % \
+ (meta['git_tag'],
+ meta['ref_obs_target_prj'],
+ get_status(meta, colorizer, build_results,
+ ignore, obs, showtime),
+ base_status, ','.join(projects))
+ else:
+ print '%-37s %-37s %-37s %s' % \
+ (meta['git_tag'],
+ get_status(meta, colorizer, build_results,
+ ignore, obs, showtime),
+ base_status, ','.join(projects))
else:
- print '%-37s %-37s %s' % \
- (meta['git_tag'], \
- get_status(meta, colorizer, build_results,
- ignore, obs, showtime),
- ','.join(projects))
+ if refprj:
+ print '%-37s %-37s %-37s %s' % \
+ (meta['git_tag'],
+ meta['ref_obs_target_prj'],
+ get_status(meta, colorizer, build_results,
+ ignore, obs, showtime),
+ ','.join(projects))
+ else:
+ print '%-37s %-37s %s' % \
+ (meta['git_tag'],
+ get_status(meta, colorizer, build_results,
+ ignore, obs, showtime),
+ ','.join(projects))
if showurls:
show_urls(meta)
@@ -185,6 +201,9 @@ class List(object):
parser.add_argument('--showtime', action='store_true',
help='show build time',
default=config.get('showtime', '').lower() == 'on')
+ parser.add_argument('--refprj', action='store_true',
+ help='Show submission reference project in project',
+ default=config.get('refprj', '').lower() == 'on')
@staticmethod
def run(argv):
@@ -192,7 +211,7 @@ class List(object):
obs = OBS(argv.apiurl, argv.apiuser, argv.apipasswd)
return list_submissions(obs, argv.project, argv.processes, argv.base,
argv.colorize, argv.showurls, argv.ignore,
- argv.showtime)
+ argv.showtime, argv.refprj)
if __name__ == '__main__':