mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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
This commit is contained in:
committed by
Martin Kosek
parent
da55aadf74
commit
2e00a9f45c
@@ -65,6 +65,8 @@ def parse_options():
|
|||||||
help="Location of CA PKCS#12 file, default /root/cacert.p12")
|
help="Location of CA PKCS#12 file, default /root/cacert.p12")
|
||||||
parser.add_option("--no-pkinit", dest="setup_pkinit", action="store_false",
|
parser.add_option("--no-pkinit", dest="setup_pkinit", action="store_false",
|
||||||
default=True, help="disables pkinit setup steps")
|
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()
|
options, args = parser.parse_args()
|
||||||
|
|
||||||
@@ -238,9 +240,11 @@ def main():
|
|||||||
|
|
||||||
replica_fqdn = args[0]
|
replica_fqdn = args[0]
|
||||||
|
|
||||||
|
standard_logging_setup(None, debug=options.debug)
|
||||||
|
|
||||||
# Just initialize the environment. This is so the installer can have
|
# Just initialize the environment. This is so the installer can have
|
||||||
# access to the plugin environment
|
# access to the plugin environment
|
||||||
api.bootstrap(in_server=True)
|
api.bootstrap(in_server=True, debug=options.debug)
|
||||||
api.finalize()
|
api.finalize()
|
||||||
|
|
||||||
#Automatically disable pkinit w/ dogtag until that is supported
|
#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)
|
sys.exit("\nThe password provided is incorrect for LDAP server %s" % api.env.host)
|
||||||
except errors.LDAPError:
|
except errors.LDAPError:
|
||||||
sys.exit("\nUnable to connect to LDAP server %s" % api.env.host)
|
sys.exit("\nUnable to connect to LDAP server %s" % api.env.host)
|
||||||
|
except errors.DatabaseError, e:
|
||||||
|
sys.exit("\n"+e.desc)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
installutils.verify_fqdn(replica_fqdn, local_hostname=False)
|
installutils.verify_fqdn(replica_fqdn, local_hostname=False)
|
||||||
|
|||||||
@@ -68,6 +68,9 @@ Location of CA PKCS#12 file, default /root/cacert.p12
|
|||||||
.TP
|
.TP
|
||||||
\fB\-\-no\-pkinit\fR
|
\fB\-\-no\-pkinit\fR
|
||||||
Disables pkinit setup steps
|
Disables pkinit setup steps
|
||||||
|
.TP
|
||||||
|
\fB\-\-debug\fR
|
||||||
|
Prints info log messages to the output
|
||||||
.SH "EXIT STATUS"
|
.SH "EXIT STATUS"
|
||||||
0 if the command was successful
|
0 if the command was successful
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user