483b06
From 9bc2481d6669906e105e1035a10cd81374464e5b Mon Sep 17 00:00:00 2001
483b06
From: Stanislav Laznicka <slaznick@redhat.com>
483b06
Date: Wed, 22 Mar 2017 17:10:56 +0100
483b06
Subject: [PATCH] Fix the order of cert-files check
483b06
483b06
Without this patch, if either of dirsrv_cert_files, http_cert_files
483b06
or pkinit_cert_files is set along with no-pkinit, the user is first
483b06
requested to add the remaining options and when they do that,
483b06
they are told that they are using 'no-pkinit' along with
483b06
'pkinit-cert-file'.
483b06
483b06
https://pagure.io/freeipa/issue/6801
483b06
483b06
Reviewed-By: Martin Basti <mbasti@redhat.com>
483b06
---
483b06
 ipaserver/install/server/__init__.py | 10 +++++-----
483b06
 1 file changed, 5 insertions(+), 5 deletions(-)
483b06
483b06
diff --git a/ipaserver/install/server/__init__.py b/ipaserver/install/server/__init__.py
483b06
index 14f1ec48a1b8c7a520db69ffad378d488efa29cc..117f51c4ebfaeba51d3c85625cda0d0eee305696 100644
483b06
--- a/ipaserver/install/server/__init__.py
483b06
+++ b/ipaserver/install/server/__init__.py
483b06
@@ -340,16 +340,16 @@ class ServerInstallInterface(ServerCertificateInstallInterface,
483b06
         cert_file_opt = (self.pkinit_cert_files,)
483b06
         if not self.no_pkinit:
483b06
             cert_file_req += cert_file_opt
483b06
-        if any(cert_file_req + cert_file_opt) and not all(cert_file_req):
483b06
-            raise RuntimeError(
483b06
-                "--dirsrv-cert-file, --http-cert-file, and --pkinit-cert-file "
483b06
-                "or --no-pkinit are required if any key file options are used."
483b06
-            )
483b06
         if self.no_pkinit and self.pkinit_cert_files:
483b06
             raise RuntimeError(
483b06
                 "--no-pkinit and --pkinit-cert-file cannot be specified "
483b06
                 "together"
483b06
             )
483b06
+        if any(cert_file_req + cert_file_opt) and not all(cert_file_req):
483b06
+            raise RuntimeError(
483b06
+                "--dirsrv-cert-file, --http-cert-file, and --pkinit-cert-file "
483b06
+                "or --no-pkinit are required if any key file options are used."
483b06
+            )
483b06
 
483b06
         if not self.interactive:
483b06
             if self.dirsrv_cert_files and self.dirsrv_pin is None:
483b06
-- 
483b06
2.12.2
483b06