Skip to content

Commit

Permalink
Adds debug logs to print out all network interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
libhe committed Sep 26, 2024
1 parent 1c319bf commit 06813ca
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion os_tests/libs/resources_libvirt.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,17 @@ def floating_ip(self):
dom = self.conn.lookupByUUIDString(uuid)
net = dom.interfaceAddresses(
libvirt.VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LEASE, 0)


# Log all network interfaces and addresses
LOG.debug(f"Interfaces for VM {self.vm_name}: {net}")

for k, v in net.items():
LOG.debug(f"Interface: {k}, Details: {v}")
if v["addrs"]:
for ipaddr in v["addrs"]:
f_ip = ipaddr["addr"]
LOG.info(f"Floating IP found: {f_ip}")
return f_ip

if not f_ip:
LOG.warning(f"No floating IP found for VM {self.vm_name}. Checking VM status.")
Expand Down

0 comments on commit 06813ca

Please sign in to comment.