[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [Freeipa-devel] [PATCH] Ask the user before overwriting /etc/named.conf



On Tue, 2009-12-01 at 10:15 -0500, Rob Crittenden wrote:
> Martin Nagy wrote:
> > Martin
> > 
> 
> ack.
> 
> As an aside, it might be nice if the actual package name(s) were used to 
> make it easier for the user to know exactly what they are missing for 
> BIND and the BIND LDAP plug-in.

Yeah, I guess you're right. New patch attached.

Martin
>From 258092b18fcba45631202833975e71817b647450 Mon Sep 17 00:00:00 2001
From: Martin Nagy <mnagy redhat com>
Date: Fri, 13 Nov 2009 16:57:51 +0100
Subject: [PATCH] Ask the user before overwriting /etc/named.conf

---
 install/tools/ipa-replica-install |    6 ++----
 install/tools/ipa-server-install  |    6 ++----
 ipaserver/install/bindinstance.py |   10 +++++++++-
 3 files changed, 13 insertions(+), 9 deletions(-)

diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index e8fabd7..9827bef 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -251,10 +251,8 @@ def check_dirsrv():
         sys.exit(1)
 
 def check_bind():
-    if not bindinstance.check_inst():
-        print "--setup-dns was specified but bind or the BIND LDAP plug-in"
-        print "is not installed on the system"
-        print "Please install bind and the LDAP plug-in and restart the setup program"
+    if not bindinstance.check_inst(unattended=True):
+        print "Aborting installation"
         sys.exit(1)
 
 def main():
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 748101d..34ddb0f 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -541,10 +541,8 @@ def main():
 
     # check bind packages are installed
     if options.setup_dns:
-        if not bindinstance.check_inst():
-            print "--setup-dns was specified but bind or the BIND LDAP plug-in"
-            print "is not installed on the system"
-            print "Please install bind and the LDAP plug-in and restart the setup program"
+        if not bindinstance.check_inst(options.unattended):
+            print "Aborting installation"
             return 1
 
     if options.ca:
diff --git a/ipaserver/install/bindinstance.py b/ipaserver/install/bindinstance.py
index 2a922a3..e2edcd3 100644
--- a/ipaserver/install/bindinstance.py
+++ b/ipaserver/install/bindinstance.py
@@ -30,17 +30,25 @@ from ipapython import sysrestore
 from ipapython import ipautil
 from ipalib import api, util
 
-def check_inst():
+def check_inst(unattended):
     # So far this file is always present in both RHEL5 and Fedora if all the necessary
     # bind packages are installed (RHEL5 requires also the pkg: caching-nameserver)
     if not os.path.exists('/etc/named.rfc1912.zones'):
+        print "BIND was not found on this system"
+        print "Please install the bind package and start the installation again"
         return False
 
     # Also check for the LDAP BIND plug-in
     if not os.path.exists('/usr/lib/bind/ldap.so') and \
        not os.path.exists('/usr/lib64/bind/ldap.so'):
+        print "The BIND LDAP plug-in was not found on this system"
+        print "Please install the bind-dyndb-ldap package and start the installation again"
         return False
 
+    if not unattended and os.path.exists('/etc/named.conf'):
+        msg = "Existing BIND configuration detected, overwrite?"
+        return ipautil.user_input(msg, False)
+
     return True
 
 class BindInstance(service.Service):
-- 
1.6.2.5


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]