Skip to content
Snippets Groups Projects

raise exception in case there is already taken host in infoblox

Merged Mohammad Torkashvand requested to merge fix/infoblox-create-host-by-ip into develop
All threads resolved!
+ 2
3
@@ -250,9 +250,8 @@ def create_host_by_ip(
@@ -250,9 +250,8 @@ def create_host_by_ip(
:term:`GSO`.
:term:`GSO`.
"""
"""
if not hostname_available(hostname):
if not hostname_available(hostname):
msg = f"FQDN {hostname} already taken, nothing to be done."
msg = f"FQDN '{hostname}' is already in use, allocation aborted."
logger.warning(msg)
raise AllocationError(msg)
return
conn, oss = _setup_connection()
conn, oss = _setup_connection()
ipv6_object = objects.IP.create(ip=str(ipv6_address), mac=NULL_MAC, configure_for_dhcp=False)
ipv6_object = objects.IP.create(ip=str(ipv6_address), mac=NULL_MAC, configure_for_dhcp=False)
Loading