mirror of
https://github.com/outbackdingo/patroni.git
synced 2026-08-25 14:53:37 +00:00
exclude members with nofailover tag (#798)
Exclude members with nofailover tag from `patronictl switchover/failover` output. Fixes https://github.com/zalando/patroni/issues/769
This commit is contained in:
committed by
Alexander Kukushkin
parent
68c0d87d42
commit
0e13677880
+2
-1
@@ -585,7 +585,8 @@ def _do_failover_or_switchover(obj, action, cluster_name, master, candidate, for
|
||||
if master is not None and cluster.leader and cluster.leader.member.name != master:
|
||||
raise PatroniCtlException('Member {0} is not the leader of cluster {1}'.format(master, cluster_name))
|
||||
|
||||
candidate_names = [str(m.name) for m in cluster.members if m.name != master]
|
||||
# excluding members with nofailover tag
|
||||
candidate_names = [str(m.name) for m in cluster.members if m.name != master and not m.nofailover]
|
||||
# We sort the names for consistent output to the client
|
||||
candidate_names.sort()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user