KRA install: show installation message only if install really started

Message that installation started/failed was shown even when
install_check fail (installation itself did not start).
This commit show messages only if installation started.

Enhacement for https://fedorahosted.org/freeipa/ticket/5455

Reviewed-By: Martin Babinsky <mbabinsk@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
Martin Basti 2015-11-23 13:38:11 +01:00
parent fa2fbc680a
commit dcaf57271c

View File

@ -152,7 +152,7 @@ class KRAInstaller(KRAInstall):
raise admintool.ScriptError(
"Directory Manager password required")
def _run(self):
def run(self):
super(KRAInstaller, self).run()
if not cainstance.is_ca_installed_locally():
@ -174,8 +174,6 @@ class KRAInstaller(KRAInstall):
raise RuntimeError("Too many parameters provided. "
"No replica file is required.")
print(dedent(self.INSTALLER_START_MESSAGE))
self.options.dm_password = self.options.password
self.options.setup_ca = False
@ -217,11 +215,10 @@ class KRAInstaller(KRAInstall):
except RuntimeError as e:
raise admintool.ScriptError(str(e))
kra.install(api, config, self.options)
print(dedent(self.INSTALLER_START_MESSAGE))
def run(self):
try:
self._run()
kra.install(api, config, self.options)
except:
self.log.error(dedent(self.FAIL_MESSAGE))
raise