Permit infrastructure test only if node is online

Permit sanity infrastructure tests only if node is online

Change-Id: I174120b313fd907e2c41c85dc3cf57a2ea0f35bd
Related-Bug: #1323252
(cherry picked from commit ab76323cdb)
This commit is contained in:
Tatyana Leontovich 2014-05-27 14:37:50 +03:00 committed by Artem Panchenko
parent 3c9f5da8bf
commit 0105f1444f
2 changed files with 9 additions and 2 deletions

View File

@ -144,6 +144,9 @@ ComputeGroup = [
cfg.ListOpt('compute_nodes',
default=[],
help="IP addresses of compute nodes"),
cfg.ListOpt('online_computes',
default=[],
help="IP addresses of online compute nodes"),
cfg.ListOpt('ceph_nodes',
default=[],
help="IP addresses of nodes with ceph-osd role"),
@ -573,6 +576,10 @@ class NailgunConfig(object):
compute_nodes = filter(lambda node: 'compute' in node['roles'],
data)
online_computes = filter(
lambda node: 'compute' in node['roles']
and node['online'] is True, data)
self.compute.online_computes = online_computes
compute_ips = []
for node in compute_nodes:
compute_ips.append(node['ip'])

View File

@ -36,8 +36,8 @@ class SanityInfrastructureTest(nmanager.SanityChecksTest):
@classmethod
def setUpClass(cls):
super(SanityInfrastructureTest, cls).setUpClass()
cls.controllers = cls.config.compute.controller_nodes
cls.computes = cls.config.compute.compute_nodes
cls.controllers = cls.config.compute.online_controllers
cls.computes = cls.config.compute.online_computes
cls.usr = cls.config.compute.controller_node_ssh_user
cls.pwd = cls.config.compute.controller_node_ssh_password
cls.key = cls.config.compute.path_to_private_key