Be more tolerant of temporary unknown states.

Change-Id: I0cecf763519fd8187072e64ff998fae704dc200e
This commit is contained in:
James E. Blair
2011-12-23 11:06:17 -08:00
parent ba2d69b81b
commit 9149699efb

View File

@@ -78,6 +78,7 @@ else:
if CLOUD_SERVERS_DRIVER == 'rackspace':
last_name = ''
error_counts = {}
for i in range(num_to_launch):
while True:
node_name = 'devstack-%s.slave.openstack.org' % int(time.time())
@@ -125,8 +126,13 @@ if CLOUD_SERVERS_DRIVER == 'rackspace':
[NodeState.UNKNOWN,
NodeState.REBOOTING,
NodeState.TERMINATED]):
print "Node %s is in error %s" % (my_node['id'],
p_node.state)
count = error_counts.get(my_node['id'], 0)
count += 1
error_counts[my_node['id']] = count
print "Node %s is in error %s (%s/5)" % (my_node['id'],
p_node.state,
count)
sys.stdout.flush()
db.setMachineState(my_node['uuid'], vmdatabase.ERROR)
if count >= 5:
db.setMachineState(my_node['uuid'], vmdatabase.ERROR)
time.sleep(3)