diff --git a/tests/system/shared/workarounds.py b/tests/system/shared/workarounds.py index 40133266ceca9a4b98ec99e247d12c0d3ec597d0..a783fb34eb73354b868fd00d0415e9a0a45c7666 100644 --- a/tests/system/shared/workarounds.py +++ b/tests/system/shared/workarounds.py @@ -160,6 +160,8 @@ class JIRA: test.fatal("FATAL: Cannot get resolution of bugreport %s" % bug, "Looks like JIRA has changed.... Please verify!") self._resolution = None + if None in (self._status, self._resolution): + self.__cropAndLog__(data) self._fetchResults_.update({bug:[self._resolution, self._status]}) # simple helper function - used as fallback if python has no ssl support @@ -180,6 +182,24 @@ class JIRA: return getOutputFromCmdline('"%s" %s %s/%s-%d' % (prog, cmdAndArgs[call], JIRA_URL, self._bugType, self._number)) return None + # this function crops multiple whitespaces from fetched and searches for expected + # ids without using regex + def __cropAndLog__(self, fetched): + fetched = " ".join(fetched.split()) + resoInd = fetched.find('resolution-val') + statInd = fetched.find('status-val') + if resoInd == statInd == -1: + test.log("Neither resolution nor status found inside fetched data.", + "%s[...]" % fetched[:200]) + else: + if resoInd == -1: + test.log("Fetched and cropped data: [...]%s[...]" % fetched[statInd-20:statInd+800]) + elif statInd == -1: + test.log("Fetched and cropped data: [...]%s[...]" % fetched[resoInd-720:resoInd+100]) + else: + test.log("Fetched and cropped data (status): [...]%s[...]" % fetched[statInd-20:statInd+300], + "Fetched and cropped data (resolution): [...]%s[...]" % fetched[resoInd-20:resoInd+100]) + # this function initializes the bug dict for localOnly usage and # for later lookup which function to call for which bug # ALWAYS update this dict when adding a new function for a workaround!