-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

The way I changed the installer with the IPv6 fix, it would require a
record in DNS for the machine hostname and fail if there was none.

The previous (and correct) behaviour is to work even if there is only
record in /etc/hosts and only warn if there are no DNS records for the
given hostname. The attached patch reverts to the original behaviour.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk0Qx9MACgkQHsardTLnvCUgLwCffxWV+dFR99zvE6Op62dm+V5f
skUAn0iO/48bDd6fLXOqEkCY2zCmAHM5
=EfTy
-----END PGP SIGNATURE-----
From ed133aa4948683b897f815285a13717df5c6ba67 Mon Sep 17 00:00:00 2001
From: Jakub Hrozek <jhro...@redhat.com>
Date: Tue, 21 Dec 2010 14:48:44 +0100
Subject: [PATCH] Do not require DNS record, just warn if one is missing

---
 ipaserver/install/installutils.py |   17 ++++++++---------
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/ipaserver/install/installutils.py b/ipaserver/install/installutils.py
index ab7bacc..c78773d 100644
--- a/ipaserver/install/installutils.py
+++ b/ipaserver/install/installutils.py
@@ -58,10 +58,6 @@ def verify_dns_records(host_name, responses, resaddr, family):
     if family not in familykw.keys():
         raise RuntimeError("Unknown faimily %s\n" % family)
 
-    if len(responses) == 0:
-        raise IOError(errno.ENOENT,
-                      "Warning: Hostname (%s) not found with NSS calls" % host_name)
-
     rec = None
     for rsn in responses:
         if rsn.dns_type == familykw[family]['dns_type']:
@@ -137,13 +133,16 @@ def verify_fqdn(host_name,no_host_dns=False):
 
     # Verify that it is a DNS A or AAAA record
     rs = dnsclient.query(host_name+".", dnsclient.DNS_C_IN, dnsclient.DNS_T_A)
-    try:
+    if len(rs) > 0:
         verify_dns_records(host_name, rs, resaddr, 'ipv4')
-    except IOError, e:
-        if e.errno == errno.ENOENT: # retry IPv6
-            rs = dnsclient.query(host_name+".", dnsclient.DNS_C_IN, dnsclient.DNS_T_AAAA)
-            verify_dns_records(host_name, rs, resaddr, 'ipv6')
+        return
 
+    rs = dnsclient.query(host_name+".", dnsclient.DNS_C_IN, dnsclient.DNS_T_AAAA)
+    if len(rs) > 0:
+        verify_dns_records(host_name, rs, resaddr, 'ipv6')
+        return
+    else:
+        print "Warning: Hostname (%s) not found in DNS" % host_name
 
 def verify_ip_address(ip):
     is_ok = True
-- 
1.7.3.3

Attachment: freeipa-jhrozek-031-dont-require-IP.patch.sig
Description: PGP signature

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

Reply via email to