From 491a6556c34fa578c1150f82b7be5ed48d59f9a5 Mon Sep 17 00:00:00 2001 From: Joshua Boniface Date: Mon, 24 Sep 2018 02:02:38 -0400 Subject: [PATCH] Fix up handling of cluster primary stepup --- router-daemon/pvcrd/RouterInstance.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/router-daemon/pvcrd/RouterInstance.py b/router-daemon/pvcrd/RouterInstance.py index 80b58983..e270590e 100644 --- a/router-daemon/pvcrd/RouterInstance.py +++ b/router-daemon/pvcrd/RouterInstance.py @@ -191,8 +191,13 @@ class RouterInstance(): except ValueError: pass - # Try to set ourself primary if there is no primary - if not self.primary_router_list: + # Try to set ourself primary if there is no primary in the cluster + 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() # Display cluster information to the terminal