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




updated patch attached

Thanks. ACK


NACK, lint failed

Attaching patch that passes lint.

--
Martin^3 Babinsky
From ed5ac82ff1574c0fa78b201605be5aec3a446895 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..386da286ab11b043ebd12e18047c73e23baa5672 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(KRAInstaller, 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