[Freeipa-devel] [PATCH] 035 Fixes for the DNS plugin

Jakub Hrozek jhrozek at redhat.com
Fri Jan 7 15:58:06 UTC 2011


On Fri, Jan 07, 2011 at 04:54:49PM +0100, Jakub Hrozek wrote:
> The attached patch fixes ticket #730 as well as a couple of typos in the
> module help.
> 
> To test:
> 
> $ ipa dnszone-add barzone.com --name-server ns.idm.lab.bos.redhat.com
> --admin-email admin at idm.lab.bos.redhat.com
> (there must be an A or AAAA record for the nameserver)
> $ ipa dnsrecord-add barzone.com foo --a-rec 1.2.3.4
> $ host foo.barzone.com
> foo.barzone.com has address 1.2.3.4
> 

Sorry, I forgot to attach the patch.
-------------- next part --------------
>From cd4f99babea1d54f3b3bbcc5a447a580cd050b5a Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhrozek at redhat.com>
Date: Fri, 7 Jan 2011 10:29:16 +0100
Subject: [PATCH] Fixes for the DNS plugin

https://fedorahosted.org/freeipa/ticket/730
---
 ipalib/plugins/dns2.py |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/ipalib/plugins/dns2.py b/ipalib/plugins/dns2.py
index e434309..57b4dbe 100644
--- a/ipalib/plugins/dns2.py
+++ b/ipalib/plugins/dns2.py
@@ -24,10 +24,10 @@ Manage DNS zone and resource records.
 EXAMPLES:
 
  Add new zone:
-   ipa dnszone-add example.com --name_server nameserver.example.com
-                               --admin_email admin at example.com
+   ipa dnszone-add example.com --name-server nameserver.example.com
+                               --admin-email admin at example.com
 
- edd second nameserver for example.com:
+ Add second nameserver for example.com:
    ipa dnsrecord-add example.com @ --ns-rec nameserver2.example.com
 
  Delete previously added nameserver from example.com:
@@ -246,6 +246,11 @@ class dnszone_add(LDAPCreate):
         entry_attrs['idnsallowdynupdate'] = str(
             entry_attrs.get('idnsallowdynupdate', False)
         ).upper()
+
+        nameserver = entry_attrs['idnssoamname']
+        nameserver = nameserver[-1] == '.' and nameserver or nameserver + '.'
+        entry_attrs['nsrecord'] = nameserver
+        entry_attrs['idnssoamname'] = nameserver
         return dn
 
 api.register(dnszone_add)
-- 
1.7.3.4



More information about the Freeipa-devel mailing list