Fix up handling of cluster primary stepup

This commit is contained in:
Joshua Boniface 2018-09-24 02:02:38 -04:00
parent 1b008f3ae1
commit 491a6556c3
1 changed files with 7 additions and 2 deletions

View File

@ -191,8 +191,13 @@ class RouterInstance():
except ValueError: except ValueError:
pass pass
# Try to set ourself primary if there is no primary # Try to set ourself primary if there is no primary in the cluster
if not self.primary_router_list: cluster_has_primary = False
for router in t_routers:
if t_routers[router].getnetworkstate() == 'primary':
cluster_has_primary = True
break
if not cluster_has_primary:
self.set_primary() self.set_primary()
# Display cluster information to the terminal # Display cluster information to the terminal