Hi,

A backtrace is no longer displayed when trying to prepare a replica
file with the local LDAP server down. Also adds --debug option and
no longer displays info log messages without it.

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

Tomas
From 59b3c9eee172c03d6c1f088619febe58cc6151d3 Mon Sep 17 00:00:00 2001
From: Tomas Babej <tba...@redhat.com>
Date: Fri, 10 Aug 2012 08:59:58 -0400
Subject: [PATCH] Improves exception handling in ipa-replica-prepare.

A backtrace is no longer displayed when trying to prepare a replica
file with the local LDAP server down. Also adds --debug option and
no longer displays info messages without it.

https://fedorahosted.org/freeipa/ticket/2939
---
 install/tools/ipa-replica-prepare | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/install/tools/ipa-replica-prepare b/install/tools/ipa-replica-prepare
index 19360fdf229738d61fd7d6f36e783374333b63f4..60c8d1660f555a355cc474aef389ca583031ff77 100755
--- a/install/tools/ipa-replica-prepare
+++ b/install/tools/ipa-replica-prepare
@@ -64,6 +64,8 @@ def parse_options():
                       help="Location of CA PKCS#12 file, default /root/cacert.p12")
     parser.add_option("--no-pkinit", dest="setup_pkinit", action="store_false",
                       default=True, help="disables pkinit setup steps")
+    parser.add_option("--debug", dest="debug", action="store_true",
+                      default=False, help="enable debugging")
 
     options, args = parser.parse_args()
 
@@ -234,9 +236,11 @@ def main():
 
     replica_fqdn = args[0]
 
+    standard_logging_setup(None, debug=options.debug)
+
     # Just initialize the environment. This is so the installer can have
     # access to the plugin environment
-    api.bootstrap(in_server=True)
+    api.bootstrap(in_server=True, debug=options.debug)
     api.finalize()
 
     #Automatically disable pkinit w/ dogtag until that is supported
@@ -266,6 +270,8 @@ def main():
         sys.exit("\nThe password provided is incorrect for LDAP server %s" % api.env.host)
     except errors.LDAPError:
         sys.exit("\nUnable to connect to LDAP server %s" % api.env.host)
+    except errors.DatabaseError, e:        
+        sys.exit("\n"+e.desc)
 
     try:
         installutils.verify_fqdn(replica_fqdn, local_hostname=False)
-- 
1.7.11.2

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

Reply via email to