From 2951901d1e85d5d787baea5934fdee7fe9a6dcb8 Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 20 Sep 2010 13:35:32 -0400 Subject: Properly handle CertificateOperationErrors in replication prepration. The problem here was two-fold: the certs manager was raising an error it didn't know about and ipa-replica-prepare wasn't catching it. ticket 249 --- install/tools/ipa-replica-prepare | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'install/tools/ipa-replica-prepare') diff --git a/install/tools/ipa-replica-prepare b/install/tools/ipa-replica-prepare index 87a3ae4ce..6e9d649ae 100755 --- a/install/tools/ipa-replica-prepare +++ b/install/tools/ipa-replica-prepare @@ -283,7 +283,11 @@ def main(): print "Copy failed %s" % e sys.exit(1) print "Creating SSL certificate for the Directory Server" - export_certdb(api.env.realm, ds_dir, dir, passwd_fname, "dscert", replica_fqdn, subject_base) + try: + export_certdb(api.env.realm, ds_dir, dir, passwd_fname, "dscert", replica_fqdn, subject_base) + except errors.CertificateOperationError, e: + print "%s" % e + sys.exit(1) if options.http_pin: passwd = options.http_pin @@ -304,7 +308,11 @@ def main(): sys.exit(1) else: print "Creating SSL certificate for the Web Server" - export_certdb(api.env.realm, ds_dir, dir, passwd_fname, "httpcert", replica_fqdn, subject_base) + try: + export_certdb(api.env.realm, ds_dir, dir, passwd_fname, "httpcert", replica_fqdn, subject_base) + except errors.CertificateOperationError, e: + print "%s" % e + sys.exit(1) print "Exporting RA certificate" export_ra_pkcs12(dir, dirman_password) -- cgit