summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimo Sorce <simo@redhat.com>2015-08-25 14:35:02 -0400
committerJan Cholasta <jcholast@redhat.com>2015-09-22 10:44:45 +0200
commitd8b1f42f171d666068583548315b4684e5f3c3a4 (patch)
tree4f4987eace0aaf1c2c24386b8c3df7b44b7ef750
parent953b1079cfc8d2da486ebb65b9cfd4d85f680c67 (diff)
downloadfreeipa-d8b1f42f171d666068583548315b4684e5f3c3a4.tar.gz
freeipa-d8b1f42f171d666068583548315b4684e5f3c3a4.tar.xz
freeipa-d8b1f42f171d666068583548315b4684e5f3c3a4.zip
Simplify the install_replica_ca function
Instantiate CAInstall only once instead of 3 times in a row always with the same values. Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
-rw-r--r--ipaserver/install/cainstance.py15
1 files changed, 5 insertions, 10 deletions
diff --git a/ipaserver/install/cainstance.py b/ipaserver/install/cainstance.py
index 5af9f4663..c4788816a 100644
--- a/ipaserver/install/cainstance.py
+++ b/ipaserver/install/cainstance.py
@@ -1505,24 +1505,19 @@ def install_replica_ca(config, postinstall=False):
# Replica of old "self-signed" master - skip installing CA
return None
+ ca = CAInstance(config.realm_name, certs.NSS_DIR,
+ dogtag_constants=dogtag.install_constants)
+ ca.dm_password = config.dirman_password
+ ca.subject_base = config.subject_base
+
if not config.setup_ca:
# We aren't configuring the CA in this step but we still need
# a minimum amount of information on the CA for this IPA install.
- ca = CAInstance(config.realm_name, certs.NSS_DIR,
- dogtag_constants=dogtag.install_constants)
- ca.dm_password = config.dirman_password
- ca.subject_base = config.subject_base
return ca
- ca = CAInstance(config.realm_name, certs.NSS_DIR,
- dogtag_constants=dogtag.install_constants)
- ca.dm_password = config.dirman_password
- ca.subject_base = config.subject_base
if ca.is_installed():
sys.exit("A CA is already configured on this system.")
- ca = CAInstance(config.realm_name, certs.NSS_DIR,
- dogtag_constants=dogtag.install_constants)
if postinstall:
# If installing this afterward the Apache NSS database already
# exists, don't remove it.