From 578f831fe90f08028c6e88e103175b9bb698b6c5 Mon Sep 17 00:00:00 2001 From: boucherv Date: Tue, 22 Aug 2017 12:08:14 +0200 Subject: More support of snaps for VNF Remove OpenStack utils in vnf_base Support snaps for quotas management in cloudify_ims Change-Id: I44e5b01bb26569276133e85dfc25bc2cceb03056 Signed-off-by: boucherv --- functest/opnfv_tests/vnf/ims/cloudify_ims.py | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) (limited to 'functest/opnfv_tests/vnf/ims/cloudify_ims.py') diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index 8f6fcec8..2733bc3a 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -24,7 +24,6 @@ import functest.opnfv_tests.vnf.ims.clearwater_ims_base as clearwater_ims_base from functest.utils.constants import CONST import functest.utils.openstack_utils as os_utils -from snaps.openstack.os_credentials import OSCreds from snaps.openstack.create_network import (NetworkSettings, SubnetSettings, OpenStackNetwork) from snaps.openstack.create_security_group import (SecurityGroupSettings, @@ -63,7 +62,6 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): raise Exception("VNF config file not found") self.snaps_creds = '' - self.created_object = [] config_file = os.path.join(self.case_dir, self.config) self.orchestrator = dict( @@ -101,12 +99,19 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): self.__logger.info("Additional pre-configuration steps") - self.snaps_creds = OSCreds( - username=self.creds['username'], - password=self.creds['password'], - auth_url=self.creds['auth_url'], - project_name=self.creds['tenant'], - identity_api_version=int(os_utils.get_keystone_client_version())) + compute_quotas = self.os_project.get_compute_quotas() + network_quotas = self.os_project.get_network_quotas() + + for key, value in ( + self.orchestrator['requirements']['compute_quotas'].items()): + setattr(compute_quotas, key, value) + + for key, value in ( + self.orchestrator['requirements']['network_quotas'].items()): + setattr(network_quotas, key, value) + + compute_quotas = self.project_ims.update_compute_quotas(compute_quotas) + network_quotas = self.project_ims.update_network_quotas(network_quotas) # needs some images self.__logger.info("Upload some OS images if it doesn't exist") @@ -392,12 +397,6 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): self.__logger.warn("Some issue during the undeployment ..") self.__logger.warn("Tenant clean continue ..") - self.__logger.info('Remove the cloudify manager OS object ..') - for creator in reversed(self.created_object): - try: - creator.clean() - except Exception as exc: - self.logger.error('Unexpected error cleaning - %s', exc) super(CloudifyIms, self).clean() @energy.enable_recording -- cgit 1.2.3-korg