Reword confirmation message

This commit is contained in:
Polina Bungina
2023-09-12 15:53:42 +02:00
parent 03d9226633
commit e013c1a6ee
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -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 |
+2 -2
View File
@@ -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
+1 -1
View File
@@ -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)