Skip to content

Commit c02b585

Browse files
elhimovoleg-jukovec
authored andcommitted
switch: minor adjustment of command output
At the end of its output `switch` displays command `switch-status` with the corresponding arguments that allows to check status of switching. This patch wraps uri argument of that command with quotes as it may contain characters that have special meaning for shell, thus it simplify subsequent call of `switch-status` command because now it can be copy-pasted from the output as-is. Closes #1194 @TarantoolBot document Title: `tt cluster failover switch` simplify subsequent launch of `switch-status`.
1 parent 89d36d7 commit c02b585

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
1414

1515
### Changed
1616

17+
- `tt cluster failover switch`: minor change in output that displays corresponding
18+
`switch-status` command with quoted URI argument so it could be copy-pasted for
19+
subsequent launch as-is.
20+
1721
### Fixed
1822

1923
## [2.10.1] - 2025-06-26

cli/cluster/cmd/failover.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ func Switch(url string, switchCtx SwitchCtx) error {
163163
return err
164164
}
165165

166-
fmt.Printf("%s\n%s %s %s\n",
166+
fmt.Printf("%s\n%s '%s' %s\n",
167167
"To check the switching status, run:",
168168
"tt cluster failover switch-status",
169169
url, uuid)

test/integration/cluster/test_cluster_failover.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ def test_cluster_failover_switch_timeout_etcd(tt_cmd, tmpdir_with_cfg, etcd):
6363
text=True,
6464
)
6565
switch_output = ps_switch.stdout.read()
66-
assert re.search(r"To check the switching status, run", switch_output)
66+
assert "To check the switching status, run" in switch_output
67+
assert f"tt cluster failover switch-status '{etcd.endpoint}/prefix'" in switch_output
6768

6869
task_id = switch_output.split(" ")[-1]
6970
task_id = "/prefix/failover/command/" + task_id.strip()

0 commit comments

Comments
 (0)