mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
cloudstack: cs_cluster: remove duplicate code error handling (#27261)
This commit is contained in:
@@ -335,8 +335,7 @@ class AnsibleCloudStackCluster(AnsibleCloudStack):
|
|||||||
cluster = None
|
cluster = None
|
||||||
if not self.module.check_mode:
|
if not self.module.check_mode:
|
||||||
res = self.query_api('addCluster', **args)
|
res = self.query_api('addCluster', **args)
|
||||||
if 'errortext' in res:
|
|
||||||
self.module.fail_json(msg="Failed: '%s'" % res['errortext'])
|
|
||||||
# API returns a list as result CLOUDSTACK-9205
|
# API returns a list as result CLOUDSTACK-9205
|
||||||
if isinstance(res['cluster'], list):
|
if isinstance(res['cluster'], list):
|
||||||
cluster = res['cluster'][0]
|
cluster = res['cluster'][0]
|
||||||
|
|||||||
Reference in New Issue
Block a user