From 3caf2508f7d9d66139473248ea8c4c2cd43383a3 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 28 Sep 2018 23:17:30 +0200 Subject: [PATCH] do not strip interface_id_ipv(4|6) if empty/None, fixes #355 --- nsupdate/api/views.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nsupdate/api/views.py b/nsupdate/api/views.py index b015fc2..d707314 100644 --- a/nsupdate/api/views.py +++ b/nsupdate/api/views.py @@ -396,11 +396,12 @@ def _on_update_success(host, fqdn, kind, ipaddr, secure, logger): for rh in host.relatedhosts.all(): if rh.available: if kind == 'ipv4': - ifid = rh.interface_id_ipv4.strip() + ifid = rh.interface_id_ipv4 netmask = host.netmask_ipv4 else: # kind == 'ipv6': - ifid = rh.interface_id_ipv6.strip() + ifid = rh.interface_id_ipv6 netmask = host.netmask_ipv6 + ifid = ifid.strip() if ifid else ifid _delete = not ifid # leave ifid empty if you don't want this rh record try: rh_fqdn = FQDN(rh.name + '.' + fqdn.host, fqdn.domain)