Skip to content

Commit 01100e8

Browse files
authored
fix: TOOLS-2986 manage roster command fix (#329)
fixed the `manage roster` command that was broken due to error standardization in the server
1 parent d95f7c5 commit 01100e8

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/live_cluster/client/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ErrorsMsgs:
1212
DC_NODE_ADD_FAIL = "Failed to add node to XDR datacenter"
1313
DC_NODE_REMOVE_FAIL = "Failed to remove node from XDR datacenter"
1414
INVALID_REWIND = 'Invalid rewind. Must be int or "all"'
15-
UNABLE_TO_DETERMINE_CLUSTER_STABILITY = "Failed to check cluster stability"
15+
INFO_SERVER_ERROR_RESPONSE = 'Failed to execute info command - server error'
1616

1717

1818
DEFAULT_CONFIG_PATH = "/etc/aerospike/aerospike.conf"

lib/live_cluster/client/node.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,11 +2401,11 @@ async def info_cluster_stable(
24012401
resp = await self._info(req)
24022402

24032403
if "error" in resp.lower():
2404-
if "cluster-not-specified-size" in resp or "unstable-cluster" in resp:
2404+
if "cluster not specified size" in resp or "unstable cluster" in resp:
24052405
raise ASInfoClusterStableError(resp)
24062406

24072407
raise ASInfoResponseError(
2408-
ErrorsMsgs.UNABLE_TO_DETERMINE_CLUSTER_STABILITY, resp
2408+
ErrorsMsgs.INFO_SERVER_ERROR_RESPONSE, resp
24092409
)
24102410

24112411
return resp

test/unit/live_cluster/client/test_node.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,8 +2052,8 @@ async def test_info_cluster_stable(self):
20522052
)
20532053

20542054
async def test_info_cluster_stable_with_errors(self):
2055-
self.info_mock.return_value = "ERROR::cluster-not-specified-size"
2056-
expected = ASInfoClusterStableError("ERROR::cluster-not-specified-size")
2055+
self.info_mock.return_value = "ERROR::cluster not specified size"
2056+
expected = ASInfoClusterStableError("ERROR::cluster not specified size")
20572057

20582058
actual = await self.node.info_cluster_stable(cluster_size=3, namespace="bar")
20592059

@@ -2066,8 +2066,8 @@ async def test_info_cluster_stable_with_errors(self):
20662066
"info_cluster_stable did not return the expected result",
20672067
)
20682068

2069-
self.info_mock.return_value = "ERROR::unstable-cluster"
2070-
expected = ASInfoClusterStableError("ERROR::unstable-cluster")
2069+
self.info_mock.return_value = "ERROR::unstable cluster"
2070+
expected = ASInfoClusterStableError("ERROR::unstable cluster")
20712071

20722072
actual = await self.node.info_cluster_stable(cluster_size=3, namespace="bar")
20732073

@@ -2082,7 +2082,7 @@ async def test_info_cluster_stable_with_errors(self):
20822082

20832083
self.info_mock.return_value = "ERROR::foo"
20842084
expected = ASInfoResponseError(
2085-
"Failed to check cluster stability", "ERROR::foo"
2085+
"Failed to execute info command - server error", "ERROR::foo"
20862086
)
20872087

20882088
actual = await self.node.info_cluster_stable(namespace="bar")

0 commit comments

Comments
 (0)