mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 17:16:23 +01:00
allow to specify limit=0 so jobhist works with apis that don't support limit
This commit is contained in:
parent
881349eaff
commit
989d7fa5d0
@ -3118,7 +3118,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if opts.csv:
|
||||
format = 'csv'
|
||||
|
||||
print_jobhistory(apiurl, project, package, repository, arch, format, int(opts.limit or 20))
|
||||
print_jobhistory(apiurl, project, package, repository, arch, format, opts.limit)
|
||||
|
||||
@cmdln.hide(1)
|
||||
def do_rlog(self, subcmd, opts, *args):
|
||||
|
@ -3566,10 +3566,12 @@ def get_buildhistory(apiurl, prj, package, repository, arch, format = 'text'):
|
||||
|
||||
def print_jobhistory(apiurl, prj, current_package, repository, arch, format = 'text', limit=20):
|
||||
import time
|
||||
query = {}
|
||||
if current_package:
|
||||
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], "package=%s&limit=%d" % (current_package, limit))
|
||||
else:
|
||||
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], "limit=%d" % (limit) )
|
||||
query['package'] = current_package
|
||||
if limit != None and int(limit) > 0:
|
||||
query['limit'] = int(limit)
|
||||
u = makeurl(apiurl, ['build', prj, repository, arch, '_jobhistory'], query )
|
||||
f = http_GET(u)
|
||||
root = ET.parse(f).getroot()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user