summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomas Babej <tbabej@redhat.com>2012-08-28 07:43:20 -0400
committerMartin Kosek <mkosek@redhat.com>2012-08-28 16:38:15 +0200
commitfacb97c0b40a4a680a49cd2ecee4cf52fc554f0e (patch)
treef4a10c4c69f4d4228ceb0ab9d1df5fbfdd0ddad0
parent6df998a1636036d92b5aad5f585f3a344ce926a4 (diff)
downloadfreeipa.git-facb97c0b40a4a680a49cd2ecee4cf52fc554f0e.tar.gz
freeipa.git-facb97c0b40a4a680a49cd2ecee4cf52fc554f0e.tar.xz
freeipa.git-facb97c0b40a4a680a49cd2ecee4cf52fc554f0e.zip
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
-rw-r--r--ipalib/plugins/host.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index 319bdf72..8f6b5262 100644
--- a/ipalib/plugins/host.py
+++ b/ipalib/plugins/host.py
@@ -108,7 +108,12 @@ def remove_fwd_ptr(ipaddr, host, domain, recordtype):
api.log.debug('deleting ipaddr %s' % ipaddr)
try:
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)
except errors.NotFound:
pass