mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-08-22 14:01:42 -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
|
@ -422,11 +422,12 @@ class AnsibleCloudStackTemplate(AnsibleCloudStack):
|
|||
'account': self.get_account(key='name'),
|
||||
'domainid': self.get_domain(key='id'),
|
||||
'projectid': self.get_project(key='id'),
|
||||
'volumeid': self.get_root_volume('id')
|
||||
'volumeid': self.get_root_volume('id'),
|
||||
'fetch_list': True,
|
||||
}
|
||||
snapshots = self.query_api('listSnapshots', **args)
|
||||
if snapshots:
|
||||
for s in snapshots['snapshot']:
|
||||
for s in snapshots:
|
||||
if snapshot in [s['name'], s['id']]:
|
||||
return self._get_by_key(key, s)
|
||||
self.module.fail_json(msg="Snapshot '%s' not found" % snapshot)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue