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

Patches attached.
From 5130ff9ed226e21a75f22fa1fa44bd28a40e5f79 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Thu, 19 Nov 2015 15:40:20 +0100
Subject: [PATCH 1/2] ipa-ca-install: error when replica file is passed with
 domain level > 0

with replica promotion (domain level > 0) there are no replica files,
thus adding replica file as parameter when domain level > 0 should be
disallowed.

https://fedorahosted.org/freeipa/ticket/5455
---
 install/tools/ipa-ca-install | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/install/tools/ipa-ca-install b/install/tools/ipa-ca-install
index 4c778d950c2015a22f896854efcd82a3513d701b..30eb0b1ca7bd3da2167e4a0f0d57685fb5374482 100755
--- a/install/tools/ipa-ca-install
+++ b/install/tools/ipa-ca-install
@@ -111,6 +111,8 @@ def install_replica(safe_options, options, filename):
     domain_level = dsinstance.get_domain_level(api)
     if domain_level > DOMAIN_LEVEL_0:
         options.promote = True
+        if filename is not None:
+            sys.exit("No replica file is required")
     else:
         options.promote = False
         if filename is None:
-- 
2.5.0

From 143c2a039f64c208daaf9ca190a3b82fef7032b7 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Mon, 23 Nov 2015 13:38:11 +0100
Subject: [PATCH 2/2] 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
---
 ipaserver/install/ipa_kra_install.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/ipaserver/install/ipa_kra_install.py b/ipaserver/install/ipa_kra_install.py
index add8250d4dabfa0cb88ea7c1c291955691b3f22b..983debaa4e4b583d93ba1df18fad4b1de49c4669 100644
--- a/ipaserver/install/ipa_kra_install.py
+++ b/ipaserver/install/ipa_kra_install.py
@@ -176,8 +176,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
 
@@ -219,12 +217,14 @@ 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
 
+    def run(self):
+        self._run()
+
-- 
2.5.0

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to