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:
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()
|
||||||
|
|
||||||
@ -293,9 +295,9 @@ class operator_scenario(base.Scenario):
|
|||||||
return (404, "Overall Status = %s, "
|
return (404, "Overall Status = %s, "
|
||||||
"Cluster status = %s/%s" %
|
"Cluster status = %s/%s" %
|
||||||
(overall_status, num_up_osds, num_of_osd))
|
(overall_status, num_up_osds, num_of_osd))
|
||||||
else:
|
else:
|
||||||
return (300, ("Ceph cluster test skipped "
|
return (300, ("Ceph cluster test skipped "
|
||||||
"as no dedicated storage found"))
|
"as no dedicated storage found"))
|
||||||
|
|
||||||
@base.scenario(admin_only=False, operator=True)
|
@base.scenario(admin_only=False, operator=True)
|
||||||
def node_check(self):
|
def node_check(self):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user