mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
* [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>
(cherry picked from commit 62ae120c50
)
Co-authored-by: Kailun <kailun.shi@gmail.com>
This commit is contained in:
parent
d8328312a1
commit
5b425fc297
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:
|
||||||
|
try:
|
||||||
cluster_key.add(self._info_cmd_helper(cmd, node))
|
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…
Reference in a new issue