mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Improves deletion of PTR records in ipa host-del
Command ipa host-del with --updatedns now can deal both with hosts which zones are in FQDN form with or without a trailing dot. https://fedorahosted.org/freeipa/ticket/2809
This commit is contained in:
committed by
Martin Kosek
parent
a5c8dcd996
commit
cb961066aa
@@ -108,7 +108,12 @@ def remove_fwd_ptr(ipaddr, host, domain, recordtype):
|
|||||||
api.log.debug('deleting ipaddr %s' % ipaddr)
|
api.log.debug('deleting ipaddr %s' % ipaddr)
|
||||||
try:
|
try:
|
||||||
revzone, revname = get_reverse_zone(ipaddr)
|
revzone, revname = get_reverse_zone(ipaddr)
|
||||||
delkw = { 'ptrrecord' : "%s.%s." % (host, domain) }
|
|
||||||
|
# in case domain is in FQDN form with a trailing dot, we needn't add
|
||||||
|
# another one, in case it has no trailing dot, dnsrecord-del will
|
||||||
|
# normalize the entry
|
||||||
|
delkw = { 'ptrrecord' : "%s.%s" % (host, domain) }
|
||||||
|
|
||||||
api.Command['dnsrecord_del'](revzone, revname, **delkw)
|
api.Command['dnsrecord_del'](revzone, revname, **delkw)
|
||||||
except errors.NotFound:
|
except errors.NotFound:
|
||||||
pass
|
pass
|
||||||
|
|||||||
Reference in New Issue
Block a user