Skip to content

Commit a52e39d

Browse files
committed
MB-69379 Show staged username in xdcr-setup --list
Change-Id: I6a6a636c453c5a507281b7707ec75cf75e0601cb Reviewed-on: https://review.couchbase.org/c/couchbase-cli/+/236608 Tested-by: Build Bot <[email protected]> Reviewed-by: Safian Ali <[email protected]>
1 parent a5d5b61 commit a52e39d

File tree

2 files changed

+9
-6
lines changed

2 files changed

+9
-6
lines changed

cbmgr.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5412,10 +5412,12 @@ def _list(self):
54125412

54135413
for cluster in clusters:
54145414
if not cluster["deleted"]:
5415-
print(f'cluster name: {cluster["name"]}')
5416-
print(f' uuid: {cluster["uuid"]}')
5417-
print(f' host name: {cluster["hostname"]}')
5418-
print(f' user name: {cluster["username"]}')
5415+
print(f' cluster name: {cluster["name"]}')
5416+
print(f' uuid: {cluster["uuid"]}')
5417+
print(f' host name: {cluster["hostname"]}')
5418+
print(f' user name: {cluster["username"]}')
5419+
if "stage" in cluster:
5420+
print(f'staged user name: {cluster["stage"]["username"]}')
54195421
print(f' uri: {cluster["uri"]}')
54205422

54215423
@staticmethod

test/test_cli.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3135,10 +3135,11 @@ def test_edit_xdcr_cert(self):
31353135

31363136
def test_list_xdcr(self):
31373137
self.server_args['remote-clusters'] = [{'name': 'name', 'uuid': '1', 'hostname': 'host', 'username': 'user',
3138-
'uri': 'uri', 'deleted': False}]
3138+
'uri': 'uri', 'deleted': False, 'stage': {'username': 'other-user'}}]
31393139
self.no_error_run(self.command + ['--list'] + self.cmd_args, self.server_args)
31403140
self.assertIn('GET:/pools/default/remoteClusters/', self.server.trace)
3141-
expected_out = ['cluster name: name', 'uuid: 1', 'host name: host', 'user name: user', 'uri: uri']
3141+
expected_out = ['cluster name: name', 'uuid: 1', 'host name: host', 'user name: user', 'uri: uri',
3142+
'staged user name: other-user']
31423143
for p in expected_out:
31433144
self.assertIn(p, self.str_output)
31443145

0 commit comments

Comments
 (0)