Replace list_hypervisors with list_services
This fixes a regression introduced with commit 88c7ea8 which replaced
list_hosts with list_hypervisors because the former is deprecated.
However, the hypervisor_hostname cannot be used as replacement for
compute hostname. This patch fixes the problem by switching to
list_services which returns compute hostnames.
Change-Id: I948429075e71e11e091703c4b12378c71c37bc29
diff --git a/tempest/api/compute/admin/test_aggregates_negative.py b/tempest/api/compute/admin/test_aggregates_negative.py
index 6df8410..a6e0efa 100644
--- a/tempest/api/compute/admin/test_aggregates_negative.py
+++ b/tempest/api/compute/admin/test_aggregates_negative.py
@@ -27,15 +27,16 @@
def setup_clients(cls):
super(AggregatesAdminNegativeTestJSON, cls).setup_clients()
cls.client = cls.os_admin.aggregates_client
- cls.hyper_client = cls.os_admin.hypervisor_client
+ cls.services_client = cls.os_admin.services_client
@classmethod
def resource_setup(cls):
super(AggregatesAdminNegativeTestJSON, cls).resource_setup()
cls.aggregate_name_prefix = 'test_aggregate'
- hyper_list = cls.hyper_client.list_hypervisors()['hypervisors']
- cls.hosts = [v['hypervisor_hostname'] for v in hyper_list
+ svc_list = cls.services_client.list_services(
+ binary='nova-compute')['services']
+ cls.hosts = [v['host'] for v in svc_list
if v['status'] == 'enabled' and v['state'] == 'up']
def _create_test_aggregate(self):
diff --git a/tempest/scenario/test_aggregates_basic_ops.py b/tempest/scenario/test_aggregates_basic_ops.py
index f762995..b515639 100644
--- a/tempest/scenario/test_aggregates_basic_ops.py
+++ b/tempest/scenario/test_aggregates_basic_ops.py
@@ -37,7 +37,7 @@
super(TestAggregatesBasicOps, cls).setup_clients()
# Use admin client by default
cls.aggregates_client = cls.os_admin.aggregates_client
- cls.hyper_client = cls.os_admin.hypervisor_client
+ cls.services_client = cls.os_admin.services_client
def _create_aggregate(self, **kwargs):
aggregate = (self.aggregates_client.create_aggregate(**kwargs)
@@ -51,9 +51,10 @@
return aggregate
def _get_host_name(self):
- hyper_list = self.hyper_client.list_hypervisors()['hypervisors']
- self.assertNotEmpty(hyper_list)
- return hyper_list[0]['hypervisor_hostname']
+ svc_list = self.services_client.list_services(
+ binary='nova-compute')['services']
+ self.assertNotEmpty(svc_list)
+ return svc_list[0]['host']
def _add_host(self, aggregate_id, host):
aggregate = (self.aggregates_client.add_host(aggregate_id, host=host)