On 16.5.2013 12:37, Ana Krivokapic wrote:
On 05/15/2013 03:49 PM, Petr Spacek wrote:
Hello,

This patch adds 'debug' and 'show' statements to nsupdate commands
generated by ipa-client-install.

https://fedorahosted.org/freeipa/ticket/3629

You probably want to add another 'show', before the last 'send' in the
`update_ssh_keys()` function.

You are right. Corrected patch is attached.

--
Petr^2 Spacek
From eb3dc29ba61854d5bf68af5413a575c9c2b71eab Mon Sep 17 00:00:00 2001
From: Petr Spacek <pspa...@redhat.com>
Date: Wed, 15 May 2013 14:54:11 +0200
Subject: [PATCH] ipa-client-install: Add 'debug' and 'show' statements to
 nsupdate commands

https://fedorahosted.org/freeipa/ticket/3629
---
 ipa-client/ipa-install/ipa-client-install | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 74523632a3140f997f73f51d512f357a6fdcdc3f..e86564dddef66ed1a75f9711de0c80b1820ee154 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -1344,18 +1344,24 @@ def do_nsupdate(update_txt):
     return result
 
 UPDATE_TEMPLATE_A = """
+debug
 zone $ZONE.
 update delete $HOSTNAME. IN A
+show
 send
 update add $HOSTNAME. $TTL IN A $IPADDRESS
+show
 send
 """
 
 UPDATE_TEMPLATE_AAAA = """
+debug
 zone $ZONE.
 update delete $HOSTNAME. IN AAAA
+show
 send
 update add $HOSTNAME. $TTL IN AAAA $IPADDRESS
+show
 send
 """
 
@@ -1446,15 +1452,16 @@ def update_ssh_keys(server, hostname, ssh_dir, create_sshfp):
         zone = '.'.join(hostname.split('.')[1:])
         ttl = 1200
 
-        update_txt = 'zone %s.\nupdate delete %s. IN SSHFP\nsend\n' % (zone, hostname)
+        update_txt = 'debug\nzone %s.\n' % zone
+        update_txt += 'update delete %s. IN SSHFP\nshow\nsend\n' % hostname
         for pubkey in pubkeys:
             sshfp = pubkey.fingerprint_dns_sha1()
             if sshfp is not None:
                 update_txt += 'update add %s. %s IN SSHFP %s\n' % (hostname, ttl, sshfp)
             sshfp = pubkey.fingerprint_dns_sha256()
             if sshfp is not None:
                 update_txt += 'update add %s. %s IN SSHFP %s\n' % (hostname, ttl, sshfp)
-        update_txt += 'send\n'
+        update_txt += 'show\nsend\n'
 
         if not do_nsupdate(update_txt):
             root_logger.warning("Could not update DNS SSHFP records.")
-- 
1.7.11.7

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

Reply via email to