Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds debug logs to print out all network interfaces #444

Merged
merged 1 commit into from
Sep 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading