Remove patronictl failover --leader option (#3129)

Option has been deprecated and should be removed in the new major release
This commit is contained in:
Polina Bungina
2024-08-16 10:18:18 +02:00
committed by GitHub
parent 7659ccd50b
commit 31cf951b69
3 changed files with 13 additions and 44 deletions
-6
View File
@@ -231,12 +231,6 @@ class TestCtl(unittest.TestCase):
self.assertIn("Candidate ['other']", result.output)
self.assertIn('Member leader is already the leader of cluster dummy', result.output)
# Temp test to check a fallback to switchover if leader is specified
with patch('patroni.ctl._do_failover_or_switchover') as failover_func_mock:
result = self.runner.invoke(ctl, ['failover', '--leader', 'leader', 'dummy'], input='0\n')
self.assertIn('Supplying a leader name using this command is deprecated', result.output)
failover_func_mock.assert_called_once_with('switchover', 'dummy', None, 'leader', None, False)
cluster = get_cluster_initialized_with_leader(sync=('leader', 'other'))
cluster.members.append(Member(0, 'async', 28, {'api_url': 'http://127.0.0.1:8012/patroni'}))
cluster.config.data['synchronous_mode'] = True