From 4906a28f31bd971f0147d61a196f95e5126f3644 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sun, 28 Dec 2014 18:33:11 +0100 Subject: [PATCH] catch IndexError when computing IP of related hosts, fixes #190 --- nsupdate/api/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nsupdate/api/views.py b/nsupdate/api/views.py index 07aef32..484b393 100644 --- a/nsupdate/api/views.py +++ b/nsupdate/api/views.py @@ -405,7 +405,7 @@ def _on_update_success(host, fqdn, kind, ipaddr, secure, logger): network = IPNetwork("%s/%d" % (ipaddr, netmask)) rh_ipaddr = str(IPAddress(network.network) + int(ifid)) rh_fqdn = FQDN(rh.name + '.' + fqdn.host, fqdn.domain) - except AddrFormatError as e: + except (IndexError, AddrFormatError) as e: logger.warning("trouble computing address of related host %s [%s]" % (rh, e)) else: logger.info("updating related host %s -> %s" % (rh_fqdn, rh_ipaddr))