On 05/19/2015 01:17 PM, Martin Babinsky wrote:
https://fedorahosted.org/freeipa/ticket/5028




updated patch attached

--
Martin^3 Babinsky
From b7c20fa1e2e7d27b8eb968bb57955c7620f83e50 Mon Sep 17 00:00:00 2001
From: Martin Babinsky <mbabi...@redhat.com>
Date: Tue, 19 May 2015 13:01:27 +0200
Subject: [PATCH] do not check for directory manager password during KRA
 uninstall

ipa-kra-install validates and asks for directory manager password during
uninstallation phase. Since this password is never used during service
uninstall, the uninstaller will not perform these checks anymore.

https://fedorahosted.org/freeipa/ticket/5028
---
 ipaserver/install/ipa_kra_install.py | 34 +++++++++++++++++-----------------
 1 file changed, 17 insertions(+), 17 deletions(-)

diff --git a/ipaserver/install/ipa_kra_install.py b/ipaserver/install/ipa_kra_install.py
index 099737fa9ae3ad5bbfb36772cb0ced9c676043f4..08b4331f4d1741b6970c676283401abf0d861673 100644
--- a/ipaserver/install/ipa_kra_install.py
+++ b/ipaserver/install/ipa_kra_install.py
@@ -74,26 +74,9 @@ class KRAInstall(admintool.AdminTool):
 
         installutils.check_server_configuration()
 
-        if self.options.unattended and self.options.password is None:
-            self.option_parser.error(
-                "Directory Manager password must be specified using -p"
-                " in unattended mode"
-            )
-
         api.bootstrap(in_server=True)
         api.finalize()
 
-    def ask_for_options(self):
-        super(KRAInstall, self).ask_for_options()
-
-        if not self.options.password:
-            self.options.password = installutils.read_password(
-                "Directory Manager", confirm=False,
-                validate=False, retry=False)
-            if self.options.password is None:
-                raise admintool.ScriptError(
-                    "Directory Manager password required")
-
     @classmethod
     def get_command_class(cls, options, args):
         if options.uninstall:
@@ -152,6 +135,12 @@ class KRAInstaller(KRAInstall):
     def validate_options(self, needs_root=True):
         super(KRAInstaller, self).validate_options(needs_root=True)
 
+        if self.options.unattended and self.options.password is None:
+            self.option_parser.error(
+                "Directory Manager password must be specified using -p"
+                " in unattended mode"
+            )
+
         dogtag_version = int(api.env.dogtag_version)
         enable_kra = api.env.enable_kra
 
@@ -187,6 +176,17 @@ class KRAInstaller(KRAInstall):
                 self.option_parser.error("Too many parameters provided.  "
                                          "No replica file is required.")
 
+    def ask_for_options(self):
+        super(KRAInstall, self).ask_for_options()
+
+        if not self.options.unattended and self.options.password is None:
+            self.options.password = installutils.read_password(
+                "Directory Manager", confirm=False,
+                validate=False, retry=False)
+            if self.options.password is None:
+                raise admintool.ScriptError(
+                    "Directory Manager password required")
+
     def _run(self):
         super(KRAInstaller, self).run()
         print dedent(self.INSTALLER_START_MESSAGE)
-- 
2.1.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