mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[aerospike_migrations] - handle exception for unstable-cluster (#900)
* [aerospike_migrations] - handle exception when unstable-cluster is returned * fix lint issue * Update changelogs/fragments/900-aerospike-migration-handle-unstable-cluster.yaml Co-authored-by: Felix Fontein <felix@fontein.de> Co-authored-by: Kailun Shi <kaishi@adobe.com> Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
parent
cf450e3a43
commit
62ae120c50
2 changed files with 9 additions and 1 deletions
|
@ -0,0 +1,3 @@
|
||||||
|
---
|
||||||
|
bugfixes:
|
||||||
|
- aerospike_migrations - handle exception when unstable-cluster is returned (https://github.com/ansible-collections/community.general/pull/900).
|
|
@ -439,7 +439,12 @@ class Migrations:
|
||||||
if target_cluster_size is not None:
|
if target_cluster_size is not None:
|
||||||
cmd = cmd + "size=" + str(target_cluster_size) + ";"
|
cmd = cmd + "size=" + str(target_cluster_size) + ";"
|
||||||
for node in self._nodes:
|
for node in self._nodes:
|
||||||
cluster_key.add(self._info_cmd_helper(cmd, node))
|
try:
|
||||||
|
cluster_key.add(self._info_cmd_helper(cmd, node))
|
||||||
|
except aerospike.exception.ServerError as e: # unstable-cluster is returned in form of Exception
|
||||||
|
if 'unstable-cluster' in e.msg:
|
||||||
|
return False
|
||||||
|
raise e
|
||||||
if len(cluster_key) == 1:
|
if len(cluster_key) == 1:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Add table
Reference in a new issue