mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-22 12:50:22 -07:00
Corrected VM metadata obtention between Abiquo versions
This commit is contained in:
parent
984d551257
commit
f8104df457
2 changed files with 34 additions and 4 deletions
|
@ -167,7 +167,12 @@ def generate_inv_from_api(enterprise_entity,config):
|
|||
meta_entity = next(link for link in (vmcollection['links']) if (link['rel']=='metadata'))
|
||||
try:
|
||||
metadata = api_get(meta_entity,config)
|
||||
inventory['_meta']['hostvars'][vm_nic] = metadata['metadata']['metadata']
|
||||
if (config.getfloat("api","version") >= 3.0):
|
||||
vm_metadata = metadata['metadata']
|
||||
else:
|
||||
vm_metadata = metadata['metadata']['metadata']
|
||||
if not vm_metadata is None:
|
||||
inventory['_meta']['hostvars'][vm_nic] = vm_metadata
|
||||
except Exception, e:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue