Skip to content

Commit

Permalink
fixes issues with insufficient data #80, #81
Browse files Browse the repository at this point in the history
refs: #80
refs: #81
  • Loading branch information
bb-Ricardo committed Sep 2, 2021
1 parent 3b07eba commit 37be99c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion module/sources/vmware/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,6 +1046,9 @@ def add_device_vm_to_inventory(self, object_type, object_data, site_name, pnic_d
# map interfaces of existing object with discovered interfaces
nic_object_dict = self.map_object_interfaces_to_current_interfaces(device_vm_object, nic_data)

if object_data.get("status", "") == "active" and (nic_ips is None or len(nic_ips.keys()) == 0):
log.warning(f"No IP addresses for '{object_name}' found!")

for int_name, int_data in nic_data.items():

# add object to interface
Expand Down Expand Up @@ -1618,7 +1621,11 @@ def add_host(self, obj):
log.debug2(f"Found host portGroup {pgroup_name}")

nic_order = grab(pgroup, "computedPolicy.nicTeaming.nicOrder")
pgroup_nics = nic_order.activeNic + nic_order.standbyNic
pgroup_nics = list()
if nic_order.activeNic is not None:
pgroup_nics += nic_order.activeNic
if nic_order.standbyNic is not None:
pgroup_nics += nic_order.standbyNic

self.network_data["host_pgroup"][name][pgroup_name] = {
"vlan_id": grab(pgroup, "spec.vlanId"),
Expand Down

0 comments on commit 37be99c

Please sign in to comment.