summaryrefslogtreecommitdiffstats
path: root/ipaserver/install/ipa_kra_install.py
diff options
context:
space:
mode:
authorPatrice Duc-Jacquet <patduc38@gmail.com>2016-05-17 10:35:42 +0200
committerMartin Basti <mbasti@redhat.com>2016-05-20 16:17:54 +0200
commit65794fc71c6b76a8fe96423e3fac128dc5de2c7d (patch)
tree86f63cb49b590ca8a81a6a14ecf9ee35f01266f3 /ipaserver/install/ipa_kra_install.py
parentad1cac12834615a4666624885ae4997286641548 (diff)
downloadfreeipa-65794fc71c6b76a8fe96423e3fac128dc5de2c7d.tar.gz
freeipa-65794fc71c6b76a8fe96423e3fac128dc5de2c7d.tar.xz
freeipa-65794fc71c6b76a8fe96423e3fac128dc5de2c7d.zip
Incorrect message when KRA already installed
When trying to install a second time KRA, in case domain-level=0 the error lessage is not correct. It mentions : "ipa-kra-install: error: A replica file is required." Note that this behavior is not observed if domain-level=1 The subject of the fix consist in checking that KRA is not already installed before going ahead in the installation process. Tests done: I have made the following tests in bot domain-level=0 and domain-level=1 : - Install KRA (check it is correctly installed), - Install KRA a second time (check that the correct error message is raised) - uninstall KRA (check that it is correctly uninstalled) - Install KRA again (check that it is correctly installed) Reviewed-By: Petr Spacek <pspacek@redhat.com>
Diffstat (limited to 'ipaserver/install/ipa_kra_install.py')
-rw-r--r--ipaserver/install/ipa_kra_install.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/ipaserver/install/ipa_kra_install.py b/ipaserver/install/ipa_kra_install.py
index 33c1072db..9cb5f0fcc 100644
--- a/ipaserver/install/ipa_kra_install.py
+++ b/ipaserver/install/ipa_kra_install.py
@@ -158,6 +158,11 @@ class KRAInstaller(KRAInstall):
raise RuntimeError("Dogtag CA is not installed. "
"Please install the CA first")
+ # check if KRA is not already installed
+ _kra = krainstance.KRAInstance(api)
+ if _kra.is_installed():
+ raise admintool.ScriptError("KRA already installed")
+
# this check can be done only when CA is installed
self.installing_replica = dogtaginstance.is_installing_replica("KRA")
self.options.promote = False