Ommit group when OS id is empty
This commit is contained in:
parent
2b4f351717
commit
d7b01396b5
11
proxmox.py
11
proxmox.py
|
@ -370,11 +370,12 @@ def main_list(options, config_path):
|
||||||
|
|
||||||
if 'proxmox_os_id' in results['_meta']['hostvars'][vm]:
|
if 'proxmox_os_id' in results['_meta']['hostvars'][vm]:
|
||||||
osid = results['_meta']['hostvars'][vm]['proxmox_os_id']
|
osid = results['_meta']['hostvars'][vm]['proxmox_os_id']
|
||||||
if osid not in results:
|
if osid:
|
||||||
results[osid] = {
|
if osid not in results:
|
||||||
'hosts': []
|
results[osid] = {
|
||||||
}
|
'hosts': []
|
||||||
results[osid]['hosts'] += [vm]
|
}
|
||||||
|
results[osid]['hosts'] += [vm]
|
||||||
|
|
||||||
results['_meta']['hostvars'][vm].update(metadata)
|
results['_meta']['hostvars'][vm].update(metadata)
|
||||||
|
|
||||||
|
|
Reference in New Issue