Merge "Fix nits and log from I996d257e089f0676e316f2b14207c343063ccf8e"
diff --git a/tempest/api/compute/admin/test_aggregates.py b/tempest/api/compute/admin/test_aggregates.py
index bf46320..7a3bfdf 100644
--- a/tempest/api/compute/admin/test_aggregates.py
+++ b/tempest/api/compute/admin/test_aggregates.py
@@ -209,17 +209,19 @@
az_name = data_utils.rand_name(self.az_name_prefix)
aggregate = self._create_test_aggregate(availability_zone=az_name)
- # Find a host that has not been added to other zone,
- # for one host can't be added to different zones.
+ # Find a host that has not been added to other availability zone,
+ # for one host can't be added to different availability zones.
aggregates = self.client.list_aggregates()['aggregates']
hosts_in_zone = []
- for v in aggregates:
- if v['availability_zone']:
- hosts_in_zone.extend(v['hosts'])
+ for agg in aggregates:
+ if agg['availability_zone']:
+ hosts_in_zone.extend(agg['hosts'])
hosts = [v for v in self.hosts_available if v not in hosts_in_zone]
if not hosts:
- raise self.skipException("All hosts are already in other zones, "
- "so can't add host to aggregate.")
+ raise self.skipException("All hosts are already in other "
+ "availability zones, so can't add "
+ "host to aggregate. \nAggregates list: "
+ "%s" % aggregates)
host = hosts[0]
self.client.add_host(aggregate['id'], host=host)