diff options
Diffstat (limited to 'testing/robot/lib/FDSLibrary.py')
-rw-r--r-- | testing/robot/lib/FDSLibrary.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/testing/robot/lib/FDSLibrary.py b/testing/robot/lib/FDSLibrary.py index 32c18eb..0d0929e 100644 --- a/testing/robot/lib/FDSLibrary.py +++ b/testing/robot/lib/FDSLibrary.py @@ -36,12 +36,17 @@ class FDSLibrary(): logger.debug("Initializing nova client.") self.nova_client = nova.Client('2', session=session.Session(auth=auth_obj)) - def check_flavor_exists(self, flavor): - flavor_list_names = [x.name for x in self.nova_client.flavors.list()] - return flavor in flavor_list_names + def check_flavor_exists(self): + flavor_names = [x for x in self.nova_client.flavors.list(min_ram=760)] + for flavor in flavor_names: + for key in flavor.get_keys(): + if "mem_page_size" in key: + logger.info("Found flavor with memory-setting: " + flavor.name) + return flavor.name def create_flavor(self, name, ram, vcpus="1", disk="0"): response = self.nova_client.flavors.create(name, ram, vcpus, disk) + response.set_keys({'hw:mem_page_size': 'large'}) return response def check_image_exists(self, image): |