diff options
author | Ciprian Barbu <ciprian.barbu@enea.com> | 2016-04-14 15:06:58 +0300 |
---|---|---|
committer | Ciprian Barbu <ciprian.barbu@enea.com> | 2016-04-18 14:45:19 +0300 |
commit | e652a91acc5079868d02366a06bccb01485739a8 (patch) | |
tree | 55c7593c7e9f759135540f848e0cd6e829173de6 /testcases/VIM/OpenStack/CI/libraries | |
parent | 7bc6b5ca7562293f7fb9f8f8fd4f60320699e240 (diff) |
Allow rally to use existing glance image
This allows to use a prebuilt glance image without deleting it after the test.
For ARM platforms this is especially helpful because the test image is
three-part and can be created before running any tests.
Change-Id: Ia79f519d10fc9155ab2fb44a3e427ae3bb1ce399
Signed-off-by: Ciprian Barbu <ciprian.barbu@enea.com>
Diffstat (limited to 'testcases/VIM/OpenStack/CI/libraries')
-rwxr-xr-x | testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py index 078e5eaa1..0ef7b4ed3 100755 --- a/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py +++ b/testcases/VIM/OpenStack/CI/libraries/run_rally-cert.py @@ -406,6 +406,7 @@ def main(): logger.debug("Using existing volume type(s)...") image_id = openstack_utils.get_image_id(glance_client, GLANCE_IMAGE_NAME) + image_exists = False if image_id == '': logger.debug("Creating image '%s' from '%s'..." % (GLANCE_IMAGE_NAME, @@ -422,6 +423,7 @@ def main(): else: logger.debug("Using existing image '%s' with ID '%s'..." \ % (GLANCE_IMAGE_NAME, image_id)) + image_exists = True if args.test_name == "all": for test_name in tests: @@ -495,10 +497,11 @@ def main(): if args.noclean: exit(0) - logger.debug("Deleting image '%s' with ID '%s'..." \ - % (GLANCE_IMAGE_NAME, image_id)) - if not openstack_utils.delete_glance_image(nova_client, image_id): - logger.error("Error deleting the glance image") + if not image_exists: + logger.debug("Deleting image '%s' with ID '%s'..." \ + % (GLANCE_IMAGE_NAME, image_id)) + if not openstack_utils.delete_glance_image(nova_client, image_id): + logger.error("Error deleting the glance image") if not volume_types: logger.debug("Deleting volume type '%s'..." \ |