Remove the use of os-hosts API that will be deprecated

The os-hosts API is deprecated as of the 2.43 microversion.
Requests made with microversion >= 2.43 will result in a 404 error.
To list and show host details, use the Hypervisors (os-hypervisors)
API.

Reference docs:
https://developer.openstack.org/api-ref/compute/?expanded=
list-hypervisors-details-detail,list-hosts-detail,list-compute-services-detail

Change-Id: I325731e930e314f8c9204d8ef954702338589e93
This commit is contained in:
chenke 2019-04-11 15:54:59 +08:00
parent 33fb684fa2
commit ce653c7fc7
1 changed files with 1 additions and 3 deletions

View File

@ -173,9 +173,7 @@ class BaseInfraOptimScenarioTest(manager.ScenarioTest):
:param metrics: The metrics add to resource when using Gnocchi
"""
host_client = self.mgr.hosts_client
all_hosts = host_client.list_hosts()['hosts']
compute_nodes = [x for x in all_hosts if x['service'] == 'compute']
compute_nodes = self.get_compute_nodes_setup()
created_instances = []
for _ in compute_nodes[:CONF.compute.min_compute_nodes]: