cloudstack: cs_cluster: remove duplicate code error handling (#27261)

This commit is contained in:
René Moser 2017-07-25 11:33:58 +02:00 committed by GitHub
parent 495f91158c
commit b3e8fa72ce

View file

@ -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]