mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-01 00:03:10 +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
|
||||
if not self.module.check_mode:
|
||||
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
|
||||
if isinstance(res['cluster'], list):
|
||||
cluster = res['cluster'][0]
|
||||
|
||||
Reference in New Issue
Block a user