From d589e4e5345ed82c68d9a011ac89f8cdbefe2ca3 Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Wed, 14 Feb 2018 16:02:53 +0100 Subject: Get properly env vars or their default values MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It defines env.get() as an unique way to get Functest env vars or their default values. It can be considered as a wrapper above os.environ. It enforces backward compatibility via CONST which mustn't be used for that purpose. It should be noted that it also stops using CONST for getting OpenStack env vars. Change-Id: I333dc1afbc0123166a7eaff8b551370098efa341 Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/openstack/vping/vping_base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'functest/opnfv_tests/openstack/vping') diff --git a/functest/opnfv_tests/openstack/vping/vping_base.py b/functest/opnfv_tests/openstack/vping/vping_base.py index 7170101f5..fae5db2d4 100644 --- a/functest/opnfv_tests/openstack/vping/vping_base.py +++ b/functest/opnfv_tests/openstack/vping/vping_base.py @@ -18,6 +18,7 @@ import uuid from functest.core import testcase from functest.opnfv_tests.openstack.snaps import snaps_utils from functest.utils.constants import CONST +from functest.utils import env from snaps.config.flavor import FlavorConfig from snaps.config.network import NetworkConfig, SubnetConfig @@ -135,7 +136,7 @@ class VPingBase(testcase.TestCase): self.logger.info( "Creating flavor with name: '%s'", self.flavor_name) - scenario = getattr(CONST, 'DEPLOY_SCENARIO') + scenario = env.get('DEPLOY_SCENARIO') flavor_metadata = None flavor_ram = 512 if 'ovs' in scenario or 'fdio' in scenario: -- cgit 1.2.3-korg