mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-12 16:56:15 +01:00
- get_sourceinfo: workaround for too long request uri (status code 414)
This commit is contained in:
parent
2f8db7fea0
commit
d45b3e49c0
14
osc/core.py
14
osc/core.py
@ -3596,7 +3596,19 @@ def show_sourceinfo(apiurl, project, nofilename, *packages):
|
||||
|
||||
|
||||
def get_sourceinfo(apiurl, project, nofilename, *packages):
|
||||
si = show_sourceinfo(apiurl, project, nofilename, *packages)
|
||||
try:
|
||||
si = show_sourceinfo(apiurl, project, nofilename, *packages)
|
||||
except HTTPError, e:
|
||||
if e.code != 414:
|
||||
raise
|
||||
if len(packages) == 1:
|
||||
raise oscerr.APIError('package name too long: %s' % packages[0])
|
||||
n = len(packages) / 2
|
||||
pkgs = packages[:n]
|
||||
res = get_sourceinfo(apiurl, project, nofilename, *pkgs)
|
||||
pkgs = packages[n:]
|
||||
res.update(get_sourceinfo(apiurl, project, nofilename, *pkgs))
|
||||
return res
|
||||
root = ET.fromstring(si)
|
||||
res = {}
|
||||
for sinfo in root.findall('sourceinfo'):
|
||||
|
Loading…
Reference in New Issue
Block a user