On 08/28/2012 02:11 PM, Tomas Babej wrote:
Hi,

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

Tomas

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

And the patch itself, once again, cries forgotten on my hard drive.

Tomas
>From a86942a0c4253272678cdf50cacf36d20e654a80 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Tue, 28 Aug 2012 07:43:20 -0400
Subject: [PATCH] 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
---
 ipalib/plugins/host.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ipalib/plugins/host.py b/ipalib/plugins/host.py
index a417ba0f7260522661c1045077af1462ff3c410e..43381e837b74bc68fe2d48c5e8757062407312a9 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
-- 
1.7.11.4

_______________________________________________
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to