Fixes #37824. cloudstack: do not rely on APIs list queries for names (#37910)

This commit is contained in:
David Passante 2018-03-26 21:53:28 +02:00 committed by ansibot
parent ce6595b567
commit abae7a49f7

View file

@ -219,7 +219,9 @@ class AnsibleCloudStackConfiguration(AnsibleCloudStack):
configurations = self.query_api('listConfigurations', **args) configurations = self.query_api('listConfigurations', **args)
if not configurations: if not configurations:
self.module.fail_json(msg="Configuration %s not found." % args['name']) 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 return configuration
def get_value(self): def get_value(self):