mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
Improve ansible-test HttpClient error handling. (#30301)
- Automatic retries on DNS lookup failures. - Handle API errors in shippable.py.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user