Skip to content
Snippets Groups Projects
Verified Commit 2d016202 authored by Karel van Klink's avatar Karel van Klink :smiley_cat:
Browse files

Include original exception when logging an error in the infoblox client

parent 224908ba
No related branches found
Tags 2.15
1 merge request!270Include original exception when logging an error in the infoblox client
Pipeline #89093 failed
......@@ -203,9 +203,9 @@ def allocate_host(
network_view=network_view,
)
created_v6 = ipaddress.IPv6Address(new_host.ipv6addr)
except InfobloxCannotCreateObject:
except InfobloxCannotCreateObject as e:
msg = f"Cannot find 1 available IP address in network {ipv6_range}."
logger.warning(msg)
logger.warning(msg, exc_info=e)
if created_v6 is None:
msg = f"Cannot find 1 available IP address in networks {allocation_networks_v6}."
......@@ -221,9 +221,9 @@ def allocate_host(
new_host.update()
new_host = objects.HostRecord.search(conn, name=hostname)
created_v4 = ipaddress.IPv4Address(new_host.ipv4addr)
except InfobloxCannotUpdateObject:
except InfobloxCannotUpdateObject as e:
msg = f"Cannot find 1 available IP address in network {ipv4_range}."
logger.warning(msg)
logger.warning(msg, exc_info=e)
if created_v4 is None:
msg = f"Cannot find 1 available IP address in networks {allocation_networks_v4}."
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment