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 ad...@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.
>From cd4f99babea1d54f3b3bbcc5a447a580cd050b5a Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@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 ad...@example.com
+   ipa dnszone-add example.com --name-server nameserver.example.com
+                               --admin-email ad...@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

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

Reply via email to