mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
inventory: ovirt4: Add support for devices without IP (#24287)
This commit is contained in:
parent
4bd04c299b
commit
2c58ac1833
1 changed files with 2 additions and 2 deletions
|
@ -182,9 +182,9 @@ def get_dict_of_struct(connection, vm):
|
||||||
(stat.name, stat.values[0].datum) for stat in stats
|
(stat.name, stat.values[0].datum) for stat in stats
|
||||||
),
|
),
|
||||||
'devices': dict(
|
'devices': dict(
|
||||||
(device.name, [ip.address for ip in device.ips]) for device in devices
|
(device.name, [ip.address for ip in device.ips]) for device in devices if device.ips
|
||||||
),
|
),
|
||||||
'ansible_host': devices[0].ips[0].address if len(devices) > 0 else None,
|
'ansible_host': next((device.ips[0].address for device in devices if device.ips), None)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue