From 68af0d2079089fbbc4f3d1c6cc4bb1fd73ca5ce9 Mon Sep 17 00:00:00 2001 From: Aurelien Lourot Date: Wed, 24 Jun 2020 16:27:35 +0200 Subject: [PATCH] Clarification --- zaza/openstack/charm_tests/neutron_arista/setup.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/zaza/openstack/charm_tests/neutron_arista/setup.py b/zaza/openstack/charm_tests/neutron_arista/setup.py index a1ade9e..4b8dfe7 100644 --- a/zaza/openstack/charm_tests/neutron_arista/setup.py +++ b/zaza/openstack/charm_tests/neutron_arista/setup.py @@ -25,10 +25,13 @@ import zaza.openstack.utilities.openstack as openstack_utils def download_arista_image(): """Download arista-cvx-virt-test.qcow2 from a web server. - If TEST_ARISTA_IMAGE_LOCAL isn't set, set it to - `/tmp/arista-cvx-virt-test.qcow2`. If TEST_ARISTA_IMAGE_REMOTE is set (e.g. - to `http://example.com/swift/v1/images/arista-cvx-virt-test.qcow2`), - download it to TEST_ARISTA_IMAGE_LOCAL. + The download will happen only if the env var TEST_ARISTA_IMAGE_REMOTE has + been set, so you don't have to set it if you already have the image + locally. + + If the env var TEST_ARISTA_IMAGE_LOCAL isn't set, it will be set to + `/tmp/arista-cvx-virt-test.qcow2`. This is where the image will be + downloaded to if TEST_ARISTA_IMAGE_REMOTE has been set. """ try: os.environ['TEST_ARISTA_IMAGE_LOCAL'] @@ -46,6 +49,8 @@ def download_arista_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 pass logging.info('Arista image can be found at {}'