test_aggregates_basic_ops picks a non compute node

test_aggregates host ties to add non-hypervisor node,
(does not runs a nova compute service) to an aggregate.

It can cause failures, if the openstack deployment has a node,
with one of the following services n-net, n-cond, n-sch, n-net,
 but without n-cpu.

It is a similar issue, what we had with the aggregate api test.

Change-Id: Idbe037da73169e0ebce8a8bb5d7652dcc39eb92b
Closing-Bug: #1318578
Related-Bug: #1294511
This commit is contained in:
Attila Fazekas 2014-05-19 16:42:22 +02:00
parent d37a5a21cb
commit 7ddb14f2d3
1 changed files with 2 additions and 2 deletions

View File

@ -54,8 +54,8 @@ class TestAggregatesBasicOps(manager.OfficialClientTest):
def _get_host_name(self):
hosts = self.compute_client.hosts.list()
self.assertTrue(len(hosts) >= 1)
hostname = hosts[0].host_name
return hostname
computes = [x for x in hosts if x.service == 'compute']
return computes[0].host_name
def _add_host(self, aggregate_name, host):
aggregate = self.compute_client.aggregates.add_host(aggregate_name,