You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the result query includes a build number, the server returns response type "resultDetails" (not "restResults" as returned by /result) which is singular but code expects a response containing 'results', resulting in:
>>> list(bamboo.get_results(key, '32'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "bamboo_api/api.py", line 372, in get_results
results = response['results']
Fix may be something like:
diff --git a/bamboo_api/api.py b/bamboo_api/api.py
index 6deaf7b..01add81 100644
--- a/bamboo_api/api.py
+++ b/bamboo_api/api.py
@@ -369,6 +369,10 @@ class BambooAPIClient(object):
while qs['start-index'] < size:
# Get page, update page size and yield branches
response = self._get_response(url, qs).json()
+ # querying a build_number returns only one response
+ if 'results' not in response:
+ yield response
+ return
results = response['results']
size = results['size']
for r in results['result']:
Or just a new method get_result() to return the single object.
The text was updated successfully, but these errors were encountered:
When the result query includes a build number, the server returns response type "resultDetails" (not "restResults" as returned by /result) which is singular but code expects a response containing 'results', resulting in:
Fix may be something like:
Or just a new method get_result() to return the single object.
The text was updated successfully, but these errors were encountered: