From 1a7b1dc0b59ce3ac713f55cb9ae6133c66d5f65d Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 30 Jan 2018 19:40:20 +0100 Subject: Removal of deprecated SNAPS-OO classes in juju_epc MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It completes the first commit about that topic [1]. [1] https://gerrit.opnfv.org/gerrit/#/c/47617/ Change-Id: I1a55b45f0535ae98681546d4d24bb424cf892aa8 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/epc/juju_epc.py | 49 ++++++++++++++------------------ 1 file changed, 21 insertions(+), 28 deletions(-) diff --git a/functest/opnfv_tests/vnf/epc/juju_epc.py b/functest/opnfv_tests/vnf/epc/juju_epc.py index 143293291..ada11c3a3 100644 --- a/functest/opnfv_tests/vnf/epc/juju_epc.py +++ b/functest/opnfv_tests/vnf/epc/juju_epc.py @@ -23,12 +23,14 @@ from functest.utils.constants import CONST import functest.utils.openstack_utils as os_utils import pkg_resources -from snaps.openstack.os_credentials import OSCreds -from snaps.openstack.create_network import (NetworkSettings, - SubnetSettings, OpenStackNetwork) -from snaps.openstack.create_router import (RouterSettings, OpenStackRouter) -from snaps.openstack.create_flavor import (FlavorSettings, OpenStackFlavor) -from snaps.openstack.create_image import (ImageSettings, OpenStackImage) +from snaps.config.flavor import FlavorConfig +from snaps.config.image import ImageConfig +from snaps.config.network import NetworkConfig, SubnetConfig +from snaps.config.router import RouterConfig +from snaps.openstack.create_flavor import OpenStackFlavor +from snaps.openstack.create_image import OpenStackImage +from snaps.openstack.create_network import OpenStackNetwork +from snaps.openstack.create_router import OpenStackRouter from snaps.openstack.utils import keystone_utils import yaml @@ -63,9 +65,7 @@ class JujuEpc(vnf.VnfOnBoarding): ) self.created_object = [] - self.snaps_creds = '' - - self.os_creds = snaps_utils.get_credentials() + self.snaps_creds = snaps_utils.get_credentials() self.details['orchestrator'] = dict( name=get_config("orchestrator.name", config_file), version=get_config("orchestrator.version", config_file), @@ -121,13 +121,6 @@ class JujuEpc(vnf.VnfOnBoarding): "auth_url": os_utils.get_credentials()['auth_url'] } - 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())) - cloud_data = { 'url': self.public_auth_url, 'pass': self.tenant_name, @@ -153,10 +146,10 @@ class JujuEpc(vnf.VnfOnBoarding): if image_file and image_name: image_creator = OpenStackImage( self.snaps_creds, - ImageSettings(name=image_name, - image_user='cloud', - img_format='qcow2', - image_file=image_file)) + ImageConfig(name=image_name, + image_user='cloud', + img_format='qcow2', + image_file=image_file)) image_creator.create() self.created_object.append(image_creator) @@ -181,11 +174,11 @@ class JujuEpc(vnf.VnfOnBoarding): 'vnf_{}_external_network_name'.format(self.case_name)) self.__logger.info("Creating full network ...") - subnet_settings = SubnetSettings(name=private_subnet_name, - cidr=private_subnet_cidr, - dns_nameservers=dns_nameserver) - network_settings = NetworkSettings(name=private_net_name, - subnet_settings=[subnet_settings]) + subnet_settings = SubnetConfig(name=private_subnet_name, + cidr=private_subnet_cidr, + dns_nameservers=dns_nameserver) + network_settings = NetworkConfig(name=private_net_name, + subnet_settings=[subnet_settings]) network_creator = OpenStackNetwork(self.snaps_creds, network_settings) network_creator.create() self.created_object.append(network_creator) @@ -194,14 +187,14 @@ class JujuEpc(vnf.VnfOnBoarding): self.__logger.info("Creating network Router ....") router_creator = OpenStackRouter( self.snaps_creds, - RouterSettings( + RouterConfig( name=abot_router, external_gateway=ext_net_name, internal_subnets=[subnet_settings.name])) router_creator.create() self.created_object.append(router_creator) self.__logger.info("Creating Flavor ....") - flavor_settings = FlavorSettings( + flavor_settings = FlavorConfig( name=self.orchestrator['requirements']['flavor']['name'], ram=self.orchestrator['requirements']['flavor']['ram_min'], disk=10, @@ -255,7 +248,7 @@ class JujuEpc(vnf.VnfOnBoarding): self.__logger.info("Upload VNFD") descriptor = self.vnf['descriptor'] self.__logger.info("Get or create flavor for all Abot-EPC") - flavor_settings = FlavorSettings( + flavor_settings = FlavorConfig( name=self.vnf['requirements']['flavor']['name'], ram=self.vnf['requirements']['flavor']['ram_min'], disk=10, -- cgit 1.2.3-korg