From 65794fc71c6b76a8fe96423e3fac128dc5de2c7d Mon Sep 17 00:00:00 2001 From: Patrice Duc-Jacquet Date: Tue, 17 May 2016 10:35:42 +0200 Subject: 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 --- ipaserver/install/ipa_kra_install.py | 5 +++++ 1 file changed, 5 insertions(+) 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 -- cgit