Author: sebb
Date: Tue Jan 28 17:06:34 2025
New Revision: 1923425
URL: http://svn.apache.org/viewvc?rev=1923425&view=rev
Log:
Revert 1923414; the response is needed
Modified:
comdev/reporter.apache.org/trunk/scripts/readjira.py
Modified: comdev/reporter.apache.org/trunk/scripts/readjira.py
URL:
http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/readjira.py?rev=1923425&r1=1923424&r2=1923425&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/readjira.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/readjira.py Tue Jan 28 17:06:34
2025
@@ -86,8 +86,11 @@ def getJIRAS(project):
return cdata['total'], rdata['total'], project
except Exception as err:
response = ''
+ # If a project cannot be found, the API returns code 400 with JSON
text of the form:
+ # {"errorMessages":["The value 'DUMMY' does not exist for the field
'project'."],"errors":{}}
+ # For some errors (e.g. auth fail), the API returns 401 or 403, in
which case the body is HTML rather than JSON
if isinstance(err, HTTPError):
- response = err.reason
+ response = err.read().decode('utf-8') # needed to check for
missing project
print("Failed to get data for %s: %s %s" % (project, err, response))
if "does not exist for the field 'project'" in response:
print("Removing %s" % file)