Improve ansible-test HttpClient error handling. (#30301)

- Automatic retries on DNS lookup failures.
- Handle API errors in shippable.py.
This commit is contained in:
Matt Clay
2017-09-13 12:23:48 -07:00
committed by GitHub
parent c77e3a74dd
commit 1a602096f5
2 changed files with 29 additions and 1 deletions

View File

@@ -7,6 +7,7 @@ from __future__ import absolute_import, print_function
# noinspection PyCompatibility
import argparse
import errno
import json
import os
import sys
@@ -44,6 +45,9 @@ def main():
response = client.get('https://api.shippable.com/jobs?runIds=%s' % run_id)
jobs = response.json()
if not isinstance(jobs, list):
raise ApplicationError(json.dumps(jobs, indent=4, sort_keys=True))
if len(jobs) == 1:
raise ApplicationError('Shippable run %s has only one job. Did you use the "Rebuild with SSH" option?' % run_id)
except ApplicationWarning as ex: