From 03603810878574908155936731e73d5dc88681fb Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Wed, 29 Jul 2015 14:18:23 +0200 Subject: [PATCH] fix an "400 Bad Request" when running against old API Updating a whole project against an old API server (experienced with 2.3.5) leads to: Server returned an error: HTTP Error 400: Bad Request unknown parameter 'nofilename' So just retry without nofilename if an 400 is thrown. --- osc/core.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/osc/core.py b/osc/core.py index b25d5d47..d583d59b 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3688,6 +3688,9 @@ def get_project_sourceinfo(apiurl, project, nofilename, *packages): try: si = show_project_sourceinfo(apiurl, project, nofilename, *packages) except HTTPError, e: + # old API servers 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: raise if len(packages) == 1: