----- Original Message -----
From: "Martin Kosek" <mko...@redhat.com>
To: "Tomas Babej" <tba...@redhat.com>
Cc: freeipa-devel@redhat.com
Sent: Tuesday, August 14, 2012 8:55:19 AM
Subject: Re: [Freeipa-devel] [PATCH] 0005-2 Improves exception handling in 
ipa-replica-prepare.

>On 08/10/2012 04:32 PM, Tomas Babej wrote:
>> Man page edited.
>> 
>> ----- Original Message -----
>> From: "Martin Kosek" <mko...@redhat.com>
>> To: "Tomas Babej" <tba...@redhat.com>
>> Cc: freeipa-devel@redhat.com
>> Sent: Friday, August 10, 2012 3:49:45 PM
>> Subject: Re: [Freeipa-devel] [PATCH] 0005 Improves exception handling in 
>> ipa-replica-prepare.
>> 
>> On 08/10/2012 03:07 PM, Tomas Babej wrote:
>>> 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
>>>
>> 
>> Looks OK. We just also need to update the ipa-replica-prepare man page, when
>> changing its options.
>> 
>> Martin
>> 
>
> I tested the patch and the ipa-replica-prepare part works fine, except for the
> man page which is not formatted correctly.
>
> Please, always test your changes in man pages, it is easy to do a formatting
> error here.
>
> Martin

I corrected the hidden glitch in the man page.

Tomas
From f13b159600229ccdf4ce36b9af3461fba788b643 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 +++++++-
 install/tools/man/ipa-replica-prepare.1 | 3 +++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/install/tools/ipa-replica-prepare b/install/tools/ipa-replica-prepare
index 210a9de116c6c6a6ba07ba5ba266993161eca936..3578488264564b6335033f87a62cd4e1e7f8b719 100755
--- a/install/tools/ipa-replica-prepare
+++ b/install/tools/ipa-replica-prepare
@@ -65,6 +65,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()
 
@@ -238,9 +240,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
@@ -270,6 +274,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)
diff --git a/install/tools/man/ipa-replica-prepare.1 b/install/tools/man/ipa-replica-prepare.1
index 7443483813959cae6f6d4a9b822e9692b6e3ba87..f30ed10c17cfde9e54c3ce9556a8d03671398227 100644
--- a/install/tools/man/ipa-replica-prepare.1
+++ b/install/tools/man/ipa-replica-prepare.1
@@ -68,6 +68,9 @@ Location of CA PKCS#12 file, default /root/cacert.p12
 .TP
 \fB\-\-no\-pkinit\fR
 Disables pkinit setup steps
+.TP
+\fB\-\-debug\fR
+Prints info log messages to the output
 .SH "EXIT STATUS"
 0 if the command was successful
 
-- 
1.7.11.2

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

Reply via email to