URL: https://github.com/freeipa/freeipa/pull/1517
Author: rcritten
 Title: #1517: Fix detection of KRA installation so upgrades can succeed
Action: opened

PR body:
"""
To determine whether KRA needs to be updated the standard
service.is_configured() was used. Since the KRA and CA share
the same service name (pki-tomcatd) this wasn't being detected
properly.

Add an additional check to see if the KRA CS.cfg is present.

https://pagure.io/freeipa/issue/7389

Signed-off-by: Rob Crittenden <rcrit...@redhat.com>
"""

To pull the PR as Git branch:
git remote add ghfreeipa https://github.com/freeipa/freeipa
git fetch ghfreeipa pull/1517/head:pr1517
git checkout pr1517
From 37f8bd55bd699b2a2a7ee58df68740dbf6c28a1c Mon Sep 17 00:00:00 2001
From: Rob Crittenden <rcrit...@redhat.com>
Date: Sun, 4 Feb 2018 11:40:24 -0500
Subject: [PATCH] Fix detection of KRA installation so upgrades can succeed

To determine whether KRA needs to be updated the standard
service.is_configured() was used. Since the KRA and CA share
the same service name (pki-tomcatd) this wasn't being detected
properly.

Add an additional check to see if the KRA CS.cfg is present.

https://pagure.io/freeipa/issue/7389

Signed-off-by: Rob Crittenden <rcrit...@redhat.com>
---
 ipaserver/install/krainstance.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/ipaserver/install/krainstance.py b/ipaserver/install/krainstance.py
index 9fd78ed941..f7549f4fd0 100644
--- a/ipaserver/install/krainstance.py
+++ b/ipaserver/install/krainstance.py
@@ -76,6 +76,14 @@ def __init__(self, realm):
 
         self.basedn = DN(('o', 'kra'), ('o', 'ipaca'))
 
+    def is_configured(self):
+        """
+        Override the default logic querying StateFile for configuration
+        status and also look whether a kra CS.cfg exists.
+        """
+        return (super(KRAInstance, self).is_configured() and
+                os.path.exists(paths.KRA_CS_CFG_PATH))
+
     def configure_instance(self, realm_name, host_name, dm_password,
                            admin_password, pkcs12_info=None, master_host=None,
                            subject_base=None, subject=None,
_______________________________________________
FreeIPA-devel mailing list -- freeipa-devel@lists.fedorahosted.org
To unsubscribe send an email to freeipa-devel-le...@lists.fedorahosted.org

Reply via email to