Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(845)

Unified Diff: appengine/findit/common/buildbucket_client.py

Issue 1622813003: [Findit] Adding support for extracting revisions from dict instead of list (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@master
Patch Set: Addressing code review comments Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | appengine/findit/common/test/buildbucket_client_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: appengine/findit/common/buildbucket_client.py
diff --git a/appengine/findit/common/buildbucket_client.py b/appengine/findit/common/buildbucket_client.py
index edb41d7a645b1cacbecf360f754d74965c84ee2f..3e42a5561a6b7d9f85fb0d35119d661e57cc595a 100644
--- a/appengine/findit/common/buildbucket_client.py
+++ b/appengine/findit/common/buildbucket_client.py
@@ -82,7 +82,8 @@ class BuildbucketBuild(object):
self.status = raw_json_data.get('status')
result_details_json = json.loads(
raw_json_data.get('result_details_json', '{}')) or {}
- self.result = result_details_json.get('properties', {}).get('result', [])
+ self.report = (result_details_json.get('properties', {}).get('result') or
+ result_details_json.get('properties', {}).get('report', {}))
class BuildbucketError(object):
@@ -145,10 +146,10 @@ def TriggerTryJobs(try_jobs):
json_results.append(json.loads(content))
else:
error_content = {
- 'error': {
- 'reason': status_code,
- 'message': content
- }
+ 'error': {
+ 'reason': status_code,
+ 'message': content
+ }
}
json_results.append(error_content)
@@ -179,10 +180,10 @@ def GetTryJobs(build_ids):
json_results.append(json.loads(content))
else:
error_content = {
- 'error': {
- 'reason': status_code,
- 'message': content
- }
+ 'error': {
+ 'reason': status_code,
+ 'message': content
+ }
}
json_results.append(error_content)
« no previous file with comments | « no previous file | appengine/findit/common/test/buildbucket_client_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698