Merge "Use functest repo variable"
[functest.git] / functest / opnfv_tests / openstack / snaps / snaps_test_runner.py
index a2dadb7..4de4437 100644 (file)
@@ -8,13 +8,14 @@
 #
 # http://www.apache.org/licenses/LICENSE-2.0
 
-# pylint: disable=missing-docstring
+"""configuration params to run snaps tests"""
 
 import logging
 
 from functest.core import unit
 from functest.opnfv_tests.openstack.snaps import snaps_utils
-from functest.utils.constants import CONST
+from functest.utils import config
+from functest.utils import env
 
 from snaps.openstack import create_flavor
 
@@ -36,15 +37,15 @@ class SnapsTestRunner(unit.Suite):
             self.ext_net_name = snaps_utils.get_ext_net_name(self.os_creds)
 
         self.netconf_override = None
-        if hasattr(CONST, 'snaps_network_config'):
-            self.netconf_override = CONST.__getattribute__(
-                'snaps_network_config')
+        if hasattr(config.CONF, 'snaps_network_config'):
+            self.netconf_override = getattr(
+                config.CONF, 'snaps_network_config')
 
         self.use_fip = (
-            CONST.__getattribute__('snaps_use_floating_ips') == 'True')
+            getattr(config.CONF, 'snaps_use_floating_ips') == 'True')
         self.use_keystone = (
-            CONST.__getattribute__('snaps_use_keystone') == 'True')
-        scenario = CONST.__getattribute__('DEPLOY_SCENARIO')
+            getattr(config.CONF, 'snaps_use_keystone') == 'True')
+        scenario = env.get('DEPLOY_SCENARIO')
 
         self.flavor_metadata = None
         if 'ovs' in scenario or 'fdio' in scenario:
@@ -53,5 +54,5 @@ class SnapsTestRunner(unit.Suite):
         self.logger.info("Using flavor metadata '%s'", self.flavor_metadata)
 
         self.image_metadata = None
-        if hasattr(CONST, 'snaps_images'):
-            self.image_metadata = CONST.__getattribute__('snaps_images')
+        if hasattr(config.CONF, 'snaps_images'):
+            self.image_metadata = getattr(config.CONF, 'snaps_images')