diff --git a/docs/citus.rst b/docs/citus.rst index 030cf93e..0b05c799 100644 --- a/docs/citus.rst +++ b/docs/citus.rst @@ -140,7 +140,7 @@ An example of ``patronictl switchover`` on the worker cluster:: | work2-1 | 172.27.0.5 | Sync Standby | running | 1 | 0 | | work2-2 | 172.27.0.7 | Leader | running | 1 | | +---------+------------+--------------+---------+----+-----------+ - Are you sure you want to switchover cluster demo, demoting current primary work2-2? [y/N]: y + Are you sure you want to perform a switchover in the cluster demo, demoting current primary work2-2? [y/N]: y 2022-12-22 07:02:40.33003 Successfully switched over to "work2-1" + Citus cluster: demo (group: 2, 7179854924063375386) ------+ | Member | Host | Role | State | TL | Lag in MB | diff --git a/patroni/ctl.py b/patroni/ctl.py index 2e17fb09..6bc8781a 100644 --- a/patroni/ctl.py +++ b/patroni/ctl.py @@ -1249,12 +1249,12 @@ def _do_failover_or_switchover(obj: Dict[str, Any], action: str, cluster_name: s demote_msg = f', demoting current leader {cluster.leader.name}' if cluster.leader else '' if scheduled_at_str: # only switchover can be scheduled - if not click.confirm(f'Are you sure you want to schedule switchover of cluster ' + if not click.confirm(f'Are you sure you want to schedule a switchover in the cluster ' f'{cluster_name} at {scheduled_at_str}{demote_msg}?'): # action as a var to catch a regression in the tests raise PatroniCtlException('Aborting scheduled ' + action) else: - if not click.confirm(f'Are you sure you want to {action} cluster {cluster_name}{demote_msg}?'): + if not click.confirm(f'Are you sure you want to perform a {action} in the cluster {cluster_name}{demote_msg}?'): raise PatroniCtlException('Aborting ' + action) # And finally the actual work diff --git a/tests/test_ctl.py b/tests/test_ctl.py index 85ffde20..d68593c7 100644 --- a/tests/test_ctl.py +++ b/tests/test_ctl.py @@ -147,7 +147,7 @@ class TestCtl(unittest.TestCase): result = self.runner.invoke(ctl, ['switchover', 'dummy', '--group', '0'], input=f'leader\nother\n{self.SCHEDULED_TS}\ny') self.assertEqual(result.exit_code, 0) - self.assertIn(f'Are you sure you want to schedule switchover of cluster dummy ' + self.assertIn(f'Are you sure you want to schedule a switchover in the cluster dummy ' f'at {self.SCHEDULED_TS}, demoting current leader', result.output) # Scheduled (abort)