diff options
author | Cedric Ollivier <cedric.ollivier@orange.com> | 2018-01-31 13:03:22 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@opnfv.org> | 2018-01-31 13:03:22 +0000 |
commit | a04bc0fa0a07f825856322bf2ebd359a232057bd (patch) | |
tree | 853dd4958bbca2ac90e480c941bdd533e6dbcfd8 | |
parent | bad712f34309cf4cf09701e900b832b2503761f6 (diff) | |
parent | 1a7b1dc0b59ce3ac713f55cb9ae6133c66d5f65d (diff) |
Merge "Removal of deprecated SNAPS-OO classes in juju_epc"
-rw-r--r-- | functest/opnfv_tests/vnf/epc/juju_epc.py | 49 |
1 files 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 14329329..ada11c3a 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, |