Skip to content
Snippets Groups Projects
Commit d94ff3df authored by Mohammad Torkashvand's avatar Mohammad Torkashvand
Browse files

raise exception in case there is already taken host in infoblox

parent 1bd37205
Branches
Tags
1 merge request!222raise exception in case there is already taken host in infoblox
Pipeline #87247 passed
......@@ -250,9 +250,8 @@ def create_host_by_ip(
:term:`GSO`.
"""
if not hostname_available(hostname):
msg = f"FQDN {hostname} already taken, nothing to be done."
logger.warning(msg)
return
msg = f"FQDN '{hostname}' is already in use, allocation aborted."
raise AllocationError(msg)
conn, oss = _setup_connection()
ipv6_object = objects.IP.create(ip=str(ipv6_address), mac=NULL_MAC, configure_for_dhcp=False)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment