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 784ecbf6c6
commit bd4048dc0d
1 changed files with 12 additions and 10 deletions

View File

@ -11,6 +11,7 @@
# under the License.
from __future__ import print_function
from cloudpulse.openstack.api import keystone_session
from cloudpulse.openstack.api.nova_api import NovaHealth
from cloudpulse.operator.ansible.openstack_node_info_reader import \
openstack_node_info_reader
@ -115,15 +116,16 @@ def get_container_name(name):
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):
importutils.import_module('keystonemiddleware.auth_token')
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'
creds = self._get_keystone_session_creds()
nova = NovaHealth(creds)
return nova.nova_hypervisor_list()
@ -293,9 +295,9 @@ class operator_scenario(base.Scenario):
return (404, "Overall Status = %s, "
"Cluster status = %s/%s" %
(overall_status, num_up_osds, num_of_osd))
else:
return (300, ("Ceph cluster test skipped "
"as no dedicated storage found"))
else:
return (300, ("Ceph cluster test skipped "
"as no dedicated storage found"))
@base.scenario(admin_only=False, operator=True)
def node_check(self):