1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

treat code 500 as 414 in get_project_sourceinfo

Depending on, e.g., the apache2 configuration, status 500 is returned in case
of an "uri too long" error.
This commit is contained in:
Marcus Huewe 2016-09-09 13:34:21 +02:00
parent 3b1409fd33
commit bdec204600

View File

@ -3767,7 +3767,9 @@ def get_project_sourceinfo(apiurl, project, nofilename, *packages):
# old API servers (e.g. 2.3.5) do not know the 'nofilename' parameter, so retry without
if e.code == 400 and nofilename:
return get_project_sourceinfo(apiurl, project, False, *packages)
if e.code != 414:
# an uri too long error is sometimes handled as status 500
# (depending, e.g., on the apache2 configuration)
if e.code not in (414, 500):
raise
if len(packages) == 1:
raise oscerr.APIError('package name too long: %s' % packages[0])