From 9f7c63ffaf64b3ca81ae86a0b3477e5007916fcd Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Thu, 22 Feb 2018 17:43:35 +0100 Subject: Switch from CONST to CONF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It also removes constants.CONST and env.Environment which are now useless. Depends-On: I764a0a2a24447c941d1e726f3116593b29dd1c1e Depends-On: I6cfa832466dcefd737314633d807512e46267a69 Change-Id: Ife41c59d9f2e6ec4e49df38af962039f99554bc5 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/ims/clearwater_ims_base.py | 8 ++++---- functest/opnfv_tests/vnf/ims/cloudify_ims.py | 4 ++-- functest/opnfv_tests/vnf/ims/cloudify_ims_perf.py | 4 ++-- functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py | 8 ++++---- functest/opnfv_tests/vnf/ims/orchestra_openims.py | 17 ++++++++--------- 5 files changed, 20 insertions(+), 21 deletions(-) (limited to 'functest/opnfv_tests/vnf/ims') diff --git a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py index f3f2e1d7c..7e1d5bb2d 100644 --- a/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py +++ b/functest/opnfv_tests/vnf/ims/clearwater_ims_base.py @@ -18,7 +18,7 @@ import pkg_resources import requests import functest.core.vnf as vnf -from functest.utils.constants import CONST +from functest.utils import config import functest.utils.functest_utils as ft_utils __author__ = ("Valentin Boucher , " @@ -33,10 +33,10 @@ class ClearwaterOnBoardingBase(vnf.VnfOnBoarding): super(ClearwaterOnBoardingBase, self).__init__(**kwargs) self.case_dir = pkg_resources.resource_filename( 'functest', 'opnfv_tests/vnf/ims') - self.data_dir = getattr(CONST, 'dir_ims_data') - self.result_dir = os.path.join(getattr(CONST, 'dir_results'), + self.data_dir = getattr(config.CONF, 'dir_ims_data') + self.result_dir = os.path.join(getattr(config.CONF, 'dir_results'), self.case_name) - self.test_dir = getattr(CONST, 'dir_repo_vims_test') + self.test_dir = getattr(config.CONF, 'dir_repo_vims_test') if not os.path.exists(self.data_dir): os.makedirs(self.data_dir) diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims.py b/functest/opnfv_tests/vnf/ims/cloudify_ims.py index aa1256aba..39bbb7678 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims.py @@ -21,7 +21,7 @@ import yaml from functest.energy import energy from functest.opnfv_tests.openstack.snaps import snaps_utils import functest.opnfv_tests.vnf.ims.clearwater_ims_base as clearwater_ims_base -from functest.utils.constants import CONST +from functest.utils import config from snaps.config.flavor import FlavorConfig from snaps.config.image import ImageConfig @@ -59,7 +59,7 @@ class CloudifyIms(clearwater_ims_base.ClearwaterOnBoardingBase): # Retrieve the configuration try: self.config = getattr( - CONST, 'vnf_{}_config'.format(self.case_name)) + config.CONF, 'vnf_{}_config'.format(self.case_name)) except Exception: raise Exception("VNF config file not found") diff --git a/functest/opnfv_tests/vnf/ims/cloudify_ims_perf.py b/functest/opnfv_tests/vnf/ims/cloudify_ims_perf.py index 72e1e447e..cdf1edc0a 100644 --- a/functest/opnfv_tests/vnf/ims/cloudify_ims_perf.py +++ b/functest/opnfv_tests/vnf/ims/cloudify_ims_perf.py @@ -25,7 +25,7 @@ from functest.opnfv_tests.vnf.ims import cloudify_ims from functest.opnfv_tests.vnf.ims.ixia.utils import IxChassisUtils from functest.opnfv_tests.vnf.ims.ixia.utils import IxLoadUtils from functest.opnfv_tests.vnf.ims.ixia.utils import IxRestUtils -from functest.utils.constants import CONST +from functest.utils import config from snaps.config.flavor import FlavorConfig from snaps.config.image import ImageConfig @@ -58,7 +58,7 @@ class CloudifyImsPerf(cloudify_ims.CloudifyIms): # Retrieve the configuration try: self.config = getattr( - CONST, 'vnf_{}_config'.format(self.case_name)) + config.CONF, 'vnf_{}_config'.format(self.case_name)) except Exception: raise Exception("VNF config file not found") diff --git a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py index e1b7f3ab0..85c55ec5f 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_clearwaterims.py @@ -20,7 +20,7 @@ import yaml import functest.core.vnf as vnf import functest.utils.openstack_utils as os_utils from functest.opnfv_tests.openstack.snaps import snaps_utils -from functest.utils.constants import CONST +from functest.utils import config from org.openbaton.cli.errors.errors import NfvoException from org.openbaton.cli.agents.agents import MainAgent @@ -150,14 +150,14 @@ class ClearwaterImsVnf(vnf.VnfOnBoarding): self.case_dir = pkg_resources.resource_filename( 'functest', 'opnfv_tests/vnf/ims/') - self.data_dir = getattr(CONST, 'dir_ims_data') - self.test_dir = getattr(CONST, 'dir_repo_vims_test') + self.data_dir = getattr(config.CONF, 'dir_ims_data') + self.test_dir = getattr(config.CONF, 'dir_repo_vims_test') self.created_resources = [] self.logger.info("%s VNF onboarding test starting", self.case_name) try: self.config = getattr( - CONST, 'vnf_{}_config'.format(self.case_name)) + config.CONF, 'vnf_{}_config'.format(self.case_name)) except BaseException: raise Exception("Orchestra VNF config file not found") diff --git a/functest/opnfv_tests/vnf/ims/orchestra_openims.py b/functest/opnfv_tests/vnf/ims/orchestra_openims.py index c35ec8c18..a8a276caf 100644 --- a/functest/opnfv_tests/vnf/ims/orchestra_openims.py +++ b/functest/opnfv_tests/vnf/ims/orchestra_openims.py @@ -19,7 +19,7 @@ import yaml import functest.core.vnf as vnf import functest.utils.openstack_utils as os_utils -from functest.utils.constants import CONST +from functest.utils import config from org.openbaton.cli.errors.errors import NfvoException from org.openbaton.cli.agents.agents import MainAgent @@ -151,14 +151,14 @@ class OpenImsVnf(vnf.VnfOnBoarding): self.case_dir = pkg_resources.resource_filename( 'functest', 'opnfv_tests/vnf/ims/') - self.data_dir = getattr(CONST, 'dir_ims_data') - self.test_dir = getattr(CONST, 'dir_repo_vims_test') + self.data_dir = getattr(config.CONF, 'dir_ims_data') + self.test_dir = getattr(config.CONF, 'dir_repo_vims_test') self.created_resources = [] self.logger.info("%s VNF onboarding test starting", self.case_name) try: self.config = getattr( - CONST, 'vnf_{}_config'.format(self.case_name)) + config.CONF, 'vnf_{}_config'.format(self.case_name)) except BaseException: raise Exception("Orchestra VNF config file not found") config_file = self.case_dir + self.config @@ -206,11 +206,10 @@ class OpenImsVnf(vnf.VnfOnBoarding): self.logger.info("Additional pre-configuration steps") self.creds = { - "tenant": self.snaps_creds.project_name, - "username": self.snaps_creds.username, - "password": self.snaps_creds.password, - "auth_url": public_auth_url - } + "tenant": self.snaps_creds.project_name, + "username": self.snaps_creds.username, + "password": self.snaps_creds.password, + "auth_url": public_auth_url} self.prepare_images() self.prepare_flavor() self.prepare_security_groups() -- cgit 1.2.3-korg