From abae7a49f7341fe5ec5980383fba28f818b7b07e Mon Sep 17 00:00:00 2001 From: David Passante Date: Mon, 26 Mar 2018 21:53:28 +0200 Subject: [PATCH] Fixes #37824. cloudstack: do not rely on APIs list queries for names (#37910) --- lib/ansible/modules/cloud/cloudstack/cs_configuration.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/cloudstack/cs_configuration.py b/lib/ansible/modules/cloud/cloudstack/cs_configuration.py index 241de695e5..43672e4ef4 100644 --- a/lib/ansible/modules/cloud/cloudstack/cs_configuration.py +++ b/lib/ansible/modules/cloud/cloudstack/cs_configuration.py @@ -219,7 +219,9 @@ class AnsibleCloudStackConfiguration(AnsibleCloudStack): configurations = self.query_api('listConfigurations', **args) if not configurations: self.module.fail_json(msg="Configuration %s not found." % args['name']) - configuration = configurations['configuration'][0] + for config in configurations['configuration']: + if args['name'] == config['name']: + configuration = config return configuration def get_value(self):