86baa9
From d5538488447a42110c2b6f77ffdc80d4c6e0e61e Mon Sep 17 00:00:00 2001
86baa9
From: Christian Heimes <cheimes@redhat.com>
86baa9
Date: Mon, 25 Mar 2019 15:58:07 +0100
86baa9
Subject: [PATCH] Consider hidden servers as role provider
86baa9
86baa9
Hidden services are now considered as associated role providers, too. This
86baa9
fixes the issue of:
86baa9
86baa9
    invalid 'PKINIT enabled server': all masters must have IPA
86baa9
    master role enabled
86baa9
86baa9
and similar issues with CA and DNS.
86baa9
86baa9
Fixes: https://pagure.io/freeipa/issue/7892
86baa9
Signed-off-by: Christian Heimes <cheimes@redhat.com>
86baa9
Reviewed-By: Thomas Woerner <twoerner@redhat.com>
86baa9
Reviewed-By: Francois Cami <fcami@redhat.com>
86baa9
---
86baa9
 ipaserver/servroles.py | 7 ++++---
86baa9
 1 file changed, 4 insertions(+), 3 deletions(-)
86baa9
86baa9
diff --git a/ipaserver/servroles.py b/ipaserver/servroles.py
86baa9
index 02a22e77dbb615f735660c53d1b2eb7da022591d..9c963be53527bb955ebf2b8cec7960f0d90717a4 100644
86baa9
--- a/ipaserver/servroles.py
86baa9
+++ b/ipaserver/servroles.py
86baa9
@@ -338,12 +338,13 @@ class ServerAttribute(LDAPBasedProperty):
86baa9
         ldap.update_entry(service_entry)
86baa9
 
86baa9
     def _get_assoc_role_providers(self, api_instance):
86baa9
-        """
86baa9
-        get list of all servers on which the associated role is enabled
86baa9
+        """get list of all servers on which the associated role is enabled
86baa9
+
86baa9
+        Consider a hidden server as a valid provider for a role.
86baa9
         """
86baa9
         return [
86baa9
             r[u'server_server'] for r in self.associated_role.status(
86baa9
-                api_instance) if r[u'status'] == ENABLED]
86baa9
+                api_instance) if r[u'status'] in {ENABLED, HIDDEN}]
86baa9
 
86baa9
     def _remove(self, api_instance, masters):
86baa9
         """
86baa9
-- 
86baa9
2.20.1
86baa9