cloudstack: added fetch_list=True where appropriate (#40233)

This commit is contained in:
Peter Farmer 2018-05-17 11:16:43 +01:00 committed by René Moser
parent 44eaa2c007
commit 912e07a036
17 changed files with 50 additions and 29 deletions

View file

@ -427,10 +427,11 @@ class AnsibleCloudStackHost(AnsibleCloudStack):
name = self.module.params.get('name')
args = {
'zoneid': self.get_zone(key='id'),
'fetch_list': True,
}
res = self.query_api('listHosts', **args)
if res:
for h in res['host']:
for h in res:
if name in [h['ipaddress'], h['name']]:
self.host = h
return self.host