aboutsummaryrefslogtreecommitdiffstats
path: root/functest/opnfv_tests/openstack/snaps
diff options
context:
space:
mode:
authorCédric Ollivier <cedric.ollivier@orange.com>2018-02-22 17:43:35 +0100
committerCédric Ollivier <cedric.ollivier@orange.com>2018-02-22 19:41:31 +0100
commit9f7c63ffaf64b3ca81ae86a0b3477e5007916fcd (patch)
tree71d1e082404d4356a1f3491482c03bbb6a6914a5 /functest/opnfv_tests/openstack/snaps
parentd701e9737f83ff29faba830df426b5a75c9746b1 (diff)
Switch from CONST to CONF
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 <cedric.ollivier@orange.com>
Diffstat (limited to 'functest/opnfv_tests/openstack/snaps')
-rw-r--r--functest/opnfv_tests/openstack/snaps/snaps_test_runner.py15
-rw-r--r--functest/opnfv_tests/openstack/snaps/snaps_utils.py5
2 files changed, 11 insertions, 9 deletions
diff --git a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py
index 34d56f70..4de44371 100644
--- a/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py
+++ b/functest/opnfv_tests/openstack/snaps/snaps_test_runner.py
@@ -14,7 +14,7 @@ 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
@@ -37,13 +37,14 @@ 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 = getattr(CONST, 'snaps_network_config')
+ if hasattr(config.CONF, 'snaps_network_config'):
+ self.netconf_override = getattr(
+ config.CONF, 'snaps_network_config')
self.use_fip = (
- getattr(CONST, 'snaps_use_floating_ips') == 'True')
+ getattr(config.CONF, 'snaps_use_floating_ips') == 'True')
self.use_keystone = (
- getattr(CONST, 'snaps_use_keystone') == 'True')
+ getattr(config.CONF, 'snaps_use_keystone') == 'True')
scenario = env.get('DEPLOY_SCENARIO')
self.flavor_metadata = None
@@ -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 = getattr(CONST, 'snaps_images')
+ if hasattr(config.CONF, 'snaps_images'):
+ self.image_metadata = getattr(config.CONF, 'snaps_images')
diff --git a/functest/opnfv_tests/openstack/snaps/snaps_utils.py b/functest/opnfv_tests/openstack/snaps/snaps_utils.py
index fc03ee9b..fa1005ea 100644
--- a/functest/opnfv_tests/openstack/snaps/snaps_utils.py
+++ b/functest/opnfv_tests/openstack/snaps/snaps_utils.py
@@ -9,6 +9,7 @@
"""Some common utils wrapping snaps functions """
+from functest.utils import config
from functest.utils import constants
from functest.utils import env
@@ -52,8 +53,8 @@ def get_credentials(proxy_settings_str=None, ssh_proxy_cmd=None):
:return: an instance of snaps OSCreds object
"""
creds_override = None
- if hasattr(constants.CONST, 'snaps_os_creds_override'):
- creds_override = getattr(constants.CONST, 'snaps_os_creds_override')
+ if hasattr(config.CONF, 'snaps_os_creds_override'):
+ creds_override = getattr(config.CONF, 'snaps_os_creds_override')
os_creds = openstack_tests.get_credentials(
os_env_file=constants.ENV_FILE, proxy_settings_str=proxy_settings_str,
ssh_proxy_cmd=ssh_proxy_cmd, overrides=creds_override)