Fixes malformed URL with hypervisor list calls

The node_check test fails on hypervisor list query when
using keystone v3.

Change-Id: Ieb2e255400bfac47b5ef50797712eb73323784a6
This commit is contained in:
Sharmin Choksey 2017-03-31 16:18:04 -07:00 committed by Vinod Pandarinathan
parent 5052a21edc
commit d76a59b98e

@ -11,6 +11,7 @@
# under the License. # under the License.
from __future__ import print_function from __future__ import print_function
from cloudpulse.openstack.api import keystone_session
from cloudpulse.openstack.api.nova_api import NovaHealth from cloudpulse.openstack.api.nova_api import NovaHealth
from cloudpulse.operator.ansible.openstack_node_info_reader import \ from cloudpulse.operator.ansible.openstack_node_info_reader import \
openstack_node_info_reader openstack_node_info_reader
@ -115,15 +116,16 @@ def get_container_name(name):
class operator_scenario(base.Scenario): class operator_scenario(base.Scenario):
def _get_keystone_session_creds(self):
creds = {'session': keystone_session._get_kssession(),
'endpoint_type': 'internalURL'
}
return creds
def _get_nova_hypervior_list(self): def _get_nova_hypervior_list(self):
importutils.import_module('keystonemiddleware.auth_token') importutils.import_module('keystonemiddleware.auth_token')
creds = {} creds = self._get_keystone_session_creds()
creds['username'] = cfg.CONF.keystone_authtoken.username
creds['project_id'] = cfg.CONF.keystone_authtoken.project_name
creds['api_key'] = cfg.CONF.keystone_authtoken.password
creds['auth_url'] = cfg.CONF.keystone_authtoken.auth_uri
creds['cacert'] = cfg.CONF.keystone_authtoken.cafile
creds['endpoint_type'] = 'internalURL'
nova = NovaHealth(creds) nova = NovaHealth(creds)
return nova.nova_hypervisor_list() return nova.nova_hypervisor_list()