Skip to content

Commit

Permalink
Merge pull request mozilla#297 from adusca/issue296
Browse files Browse the repository at this point in the history
Issue 296: Look for 'request_id' key when 'requests' doesn't exist
  • Loading branch information
vaibhavmagarwal committed Jul 17, 2015
2 parents 92a372a + 1dc65b6 commit 3c1b16a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion mozci/query_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ def _get_all_jobs(self, repo_name, revision):

def get_buildapi_request_id(self, repo_name, job):
""" Method to return buildapi's request_id for a job. """
return job["requests"][0]["request_id"]
# Most jobs have a "requests" key, but sometimes there is just
# a "request_id" key.
if "requests" in job:
return job["requests"][0]["request_id"]
return job["request_id"]

def get_matching_jobs(self, repo_name, revision, buildername):
"""Return all jobs that matched the criteria."""
Expand Down

0 comments on commit 3c1b16a

Please sign in to comment.