From d7be74e6dee301327dfd6e8be2171b811648d919 Mon Sep 17 00:00:00 2001 From: Linda Wang Date: Wed, 22 Nov 2017 03:45:45 +0000 Subject: Remove openstack utils calls in rally and tempest Mainly, update "rally deployment create --file=rally_conf.json" to "rally deployment create --fromenv" Change-Id: I6dd4c7ea2d9d6f47dee49a4fd416e62bd557f45e Signed-off-by: Linda Wang --- functest/opnfv_tests/openstack/tempest/conf_utils.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'functest/opnfv_tests/openstack/tempest') diff --git a/functest/opnfv_tests/openstack/tempest/conf_utils.py b/functest/opnfv_tests/openstack/tempest/conf_utils.py index a361c5061..b4026def3 100644 --- a/functest/opnfv_tests/openstack/tempest/conf_utils.py +++ b/functest/opnfv_tests/openstack/tempest/conf_utils.py @@ -8,7 +8,6 @@ # http://www.apache.org/licenses/LICENSE-2.0 # import ConfigParser -import json import logging import fileinput import os @@ -20,7 +19,6 @@ import yaml from functest.utils.constants import CONST import functest.utils.functest_utils as ft_utils -import functest.utils.openstack_utils as os_utils IMAGE_ID_ALT = None @@ -80,11 +78,7 @@ def create_rally_deployment(): % CONST.__getattribute__('rally_deployment_name')), verbose=False) - rally_conf = os_utils.get_credentials_for_rally() - with open('rally_conf.json', 'w') as fp: - json.dump(rally_conf, fp) - cmd = ("rally deployment create " - "--file=rally_conf.json --name={0}" + cmd = ("rally deployment create --fromenv --name={0}" .format(CONST.__getattribute__('rally_deployment_name'))) error_msg = "Problem while creating Rally deployment" ft_utils.execute_command_raise(cmd, error_msg=error_msg) @@ -279,7 +273,9 @@ def configure_tempest_update_params(tempest_conf_file, image_id=None, config.set('compute-feature-enabled', 'live_migration', True) config.set('identity', 'region', 'RegionOne') - if os_utils.is_keystone_v3(): + identity_api_version = os.getenv( + "OS_IDENTITY_API_VERSION", os.getenv("IDENTITY_API_VERSION")) + if (identity_api_version == '3'): auth_version = 'v3' else: auth_version = 'v2' @@ -292,7 +288,7 @@ def configure_tempest_update_params(tempest_conf_file, image_id=None, if CONST.__getattribute__('OS_ENDPOINT_TYPE') is not None: sections = config.sections() - if os_utils.is_keystone_v3(): + if (identity_api_version == '3'): config.set('identity', 'v3_endpoint_type', CONST.__getattribute__('OS_ENDPOINT_TYPE')) if 'identity-feature-enabled' not in sections: -- cgit 1.2.3-korg