From b3e8fa72ce84b35d91ebd097b3fce363d174c453 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Moser?= Date: Tue, 25 Jul 2017 11:33:58 +0200 Subject: [PATCH] cloudstack: cs_cluster: remove duplicate code error handling (#27261) --- lib/ansible/modules/cloud/cloudstack/cs_cluster.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/ansible/modules/cloud/cloudstack/cs_cluster.py b/lib/ansible/modules/cloud/cloudstack/cs_cluster.py index 790d26e387..685752df45 100644 --- a/lib/ansible/modules/cloud/cloudstack/cs_cluster.py +++ b/lib/ansible/modules/cloud/cloudstack/cs_cluster.py @@ -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]