Merge pull request #401 from openstack-charmers/lourot/arista-pre-deploy

Retry on failures to download Arista image
This commit is contained in:
Frode Nordahl
2020-09-09 09:57:30 +02:00
committed by GitHub

View File

@@ -45,9 +45,15 @@ def download_arista_image():
if os.environ['TEST_ARISTA_IMAGE_REMOTE']:
logging.info('Downloading Arista image from {}'
.format(os.environ['TEST_ARISTA_IMAGE_REMOTE']))
openstack_utils.download_image(
os.environ['TEST_ARISTA_IMAGE_REMOTE'],
os.environ['TEST_ARISTA_IMAGE_LOCAL'])
for attempt in tenacity.Retrying(
stop=tenacity.stop_after_attempt(3),
reraise=True):
with attempt:
openstack_utils.download_image(
os.environ['TEST_ARISTA_IMAGE_REMOTE'],
os.environ['TEST_ARISTA_IMAGE_LOCAL'])
except KeyError:
# TEST_ARISTA_IMAGE_REMOTE isn't set, which means the image is already
# available at TEST_ARISTA_IMAGE_LOCAL