VMware: Fixed vmware fact gathering when no physical interfaces have IP Addresses (#42600)
* Changed vmware_guest_facts to accuretly reflect ip as displayed in vcenter * fixed ipv6 check
This commit is contained in:
parent
8bc4a18500
commit
055ee048ce
1 changed files with 5 additions and 7 deletions
|
@ -352,13 +352,11 @@ def gather_vm_facts(content, vm):
|
|||
for device in vmnet:
|
||||
net_dict[device.macAddress] = list(device.ipAddress)
|
||||
|
||||
for dummy, v in iteritems(net_dict):
|
||||
for ipaddress in v:
|
||||
if ipaddress:
|
||||
if '::' in ipaddress:
|
||||
facts['ipv6'] = ipaddress
|
||||
else:
|
||||
facts['ipv4'] = ipaddress
|
||||
if vm.guest.ipAddress:
|
||||
if ':' in vm.guest.ipAddress:
|
||||
facts['ipv6'] = vm.guest.ipAddress
|
||||
else:
|
||||
facts['ipv4'] = vm.guest.ipAddress
|
||||
|
||||
ethernet_idx = 0
|
||||
for entry in vm.config.hardware.device:
|
||||
|
|
Loading…
Reference in a new issue