Skip to content

Commit

Permalink
fix: always compute rh_fqdn
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasWaldmann committed Apr 25, 2015
1 parent 0c425e1 commit ceb016a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nsupdate/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,11 +400,11 @@ def _on_update_success(host, fqdn, kind, ipaddr, secure, logger):
netmask = host.netmask_ipv6
_delete = not ifid # leave ifid empty if you don't want this rh record
try:
rh_fqdn = FQDN(rh.name + '.' + fqdn.host, fqdn.domain)
if not _delete:
ifid = IPAddress(ifid)
network = IPNetwork("%s/%d" % (ipaddr, netmask))
rh_ipaddr = str(IPAddress(network.network) + int(ifid))
rh_fqdn = FQDN(rh.name + '.' + fqdn.host, fqdn.domain)
except (IndexError, AddrFormatError) as e:
logger.warning("trouble computing address of related host %s [%s]" % (rh, e))
else:
Expand Down

0 comments on commit ceb016a

Please sign in to comment.