[ADMIN_API] Don't change LB state on node state change

It is possible for a monitor problem to happen at the same time as a DELETE
changing state from PENDING_DELETE/DELETED to DEGRADED/ACTIVE.

This patch stops the state changing if the initial state is not correct

Change-Id: I4af872c3eb05a526acc489029c29e037596b9abe
This commit is contained in:
Andrew Hutchings
2013-10-23 13:41:28 +01:00
committed by David Shrewsbury
parent ee626114e4
commit 277a48d31d

View File

@@ -58,10 +58,10 @@ class DbDriver(AlertDriver):
if lb.status == 'ERROR':
lb.errmsg = "Load balancer has failed"
elif degraded:
elif lb.status == 'ACTIVE' and degraded:
lb.errmsg = "A node on the load balancer has failed"
lb.status = 'DEGRADED'
else:
elif lb.status == 'DEGRADED' and not degraded:
lb.errmsg = "A node on the load balancer has recovered"
lb.status = 'ACTIVE'