Skip to content
Snippets Groups Projects
Commit 99c383b5 authored by Mohammad Torkashvand's avatar Mohammad Torkashvand Committed by Neda Moeini
Browse files

raise exception in case there is already taken host in infoblox

parent 1bd37205
Branches
No related tags found
No related merge requests found
Pipeline #87244 canceled
This commit is part of merge request !222. Comments created here will be created in the context of that merge request.
...@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment