mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
Add retries for ansible-test docker run.
This commit is contained in:
parent
ae2d2860f5
commit
4f3dade266
1 changed files with 9 additions and 1 deletions
|
@ -246,7 +246,15 @@ def docker_run(args, image, options):
|
|||
if not options:
|
||||
options = []
|
||||
|
||||
return docker_command(args, ['run'] + options + [image], capture=True)
|
||||
for _ in range(1, 3):
|
||||
try:
|
||||
return docker_command(args, ['run'] + options + [image], capture=True)
|
||||
except SubprocessError as ex:
|
||||
display.error(ex)
|
||||
display.warning('Failed to run docker image "%s". Waiting a few seconds before trying again.' % image)
|
||||
time.sleep(3)
|
||||
|
||||
raise ApplicationError('Failed to run docker image "%s".' % image)
|
||||
|
||||
|
||||
def docker_rm(args, container_id):
|
||||
|
|
Loading…
Reference in a new issue