mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-30 12:59:09 -07:00
cloudstack: added fetch_list=True where appropriate (#40233)
This commit is contained in:
parent
44eaa2c007
commit
912e07a036
17 changed files with 50 additions and 29 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue