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:
anikin-aa
2018-08-29 16:07:01 +02:00
committed by Alexander Kukushkin
parent 68c0d87d42
commit 0e13677880
+2 -1
View File
@@ -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()