Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: TOOLS-2986 manage roster command fix #329

Merged
merged 1 commit into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/live_cluster/client/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ErrorsMsgs:
DC_NODE_ADD_FAIL = "Failed to add node to XDR datacenter"
DC_NODE_REMOVE_FAIL = "Failed to remove node from XDR datacenter"
INVALID_REWIND = 'Invalid rewind. Must be int or "all"'
UNABLE_TO_DETERMINE_CLUSTER_STABILITY = "Failed to check cluster stability"
INFO_SERVER_ERROR_RESPONSE = 'Failed to execute info command - server error'


DEFAULT_CONFIG_PATH = "/etc/aerospike/aerospike.conf"
4 changes: 2 additions & 2 deletions lib/live_cluster/client/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -2401,11 +2401,11 @@ async def info_cluster_stable(
resp = await self._info(req)

if "error" in resp.lower():
if "cluster-not-specified-size" in resp or "unstable-cluster" in resp:
if "cluster not specified size" in resp or "unstable cluster" in resp:
raise ASInfoClusterStableError(resp)

raise ASInfoResponseError(
ErrorsMsgs.UNABLE_TO_DETERMINE_CLUSTER_STABILITY, resp
ErrorsMsgs.INFO_SERVER_ERROR_RESPONSE, resp
)

return resp
Expand Down
10 changes: 5 additions & 5 deletions test/unit/live_cluster/client/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -2052,8 +2052,8 @@ async def test_info_cluster_stable(self):
)

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

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

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

self.info_mock.return_value = "ERROR::unstable-cluster"
expected = ASInfoClusterStableError("ERROR::unstable-cluster")
self.info_mock.return_value = "ERROR::unstable cluster"
expected = ASInfoClusterStableError("ERROR::unstable cluster")

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

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

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

actual = await self.node.info_cluster_stable(namespace="bar")
Expand Down
Loading