Log the raised message when DNS check_zone_overlap fails

The check can fail for a lot of other reasons than there is
overlap so the error should be logged.

This causes confusion when --auto-reverse is requested and
some lookup fails causing the reverse to not be created.

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Francois Cami <fcami@redhat.com>
This commit is contained in:
Rob Crittenden 2019-06-20 16:27:32 -04:00 committed by Christian Heimes
parent ac86707de3
commit 0184e967e5

View File

@ -327,9 +327,10 @@ def get_auto_reverse_zones(ip_addresses, allow_zone_overlap=False):
if not allow_zone_overlap: if not allow_zone_overlap:
try: try:
dnsutil.check_zone_overlap(default_reverse) dnsutil.check_zone_overlap(default_reverse)
except ValueError: except ValueError as e:
logger.info("Reverse zone %s for IP address %s already exists", logger.info("Reverse zone %s for IP address %s already exists",
default_reverse, ip) default_reverse, ip)
logger.debug('%s', e)
continue continue
auto_zones.append((ip, default_reverse)) auto_zones.append((ip, default_reverse))
return auto_zones return auto_zones