From 703d4477d2385d3c654cdac549b936c08b9c5b31 Mon Sep 17 00:00:00 2001 From: helenyao Date: Wed, 7 Dec 2016 21:24:24 -0500 Subject: Authenticate clients with keystoneauth1.session JIRA: FUNCTEST-529 1. use keystoneauth1.session to initialize the client for each service The keystoneauth1.session.Session class was introduced into keystoneauth1 as an attempt to bring a unified interface to the various OpenStack clients that share common authentication and request parameters between a variety of services. 2. update ODL case to leverage session to get the endpoint info Change-Id: Ic8c01b9b7ed86d3bdd9f5125504bc47f46a37700 Signed-off-by: helenyao --- functest/opnfv_tests/sdn/odl/odl.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'functest/opnfv_tests/sdn/odl/odl.py') diff --git a/functest/opnfv_tests/sdn/odl/odl.py b/functest/opnfv_tests/sdn/odl/odl.py index 95440746..bc9f1bb7 100755 --- a/functest/opnfv_tests/sdn/odl/odl.py +++ b/functest/opnfv_tests/sdn/odl/odl.py @@ -146,11 +146,8 @@ class ODLTests(testcase_base.TestcaseBase): def run(self): try: - kclient = op_utils.get_keystone_client() - keystone_url = kclient.service_catalog.url_for( - service_type='identity', endpoint_type='publicURL') - neutron_url = kclient.service_catalog.url_for( - service_type='network', endpoint_type='publicURL') + keystone_url = op_utils.get_endpoint(service_type='identity') + neutron_url = op_utils.get_endpoint(service_type='network') kwargs = {'keystoneip': urlparse.urlparse(keystone_url).hostname} kwargs['neutronip'] = urlparse.urlparse(neutron_url).hostname kwargs['odlip'] = kwargs['neutronip'] -- cgit 1.2.3-korg