Don't limit role-find by hostname when searching for last KRA

The "is this the last KRA" test did a role-find including the
current server. This skewed the result if the server to be
removed has a KRA installed, it would always return "not allowed"
because len(roles) == 1 and the name matched, regardless of
whether other servers also provided a KRA.

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

Signed-off-by: Rob Crittenden <rcritten@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Rob Crittenden
2021-11-22 10:53:20 -05:00
parent da4a7d29e9
commit 3bcbc869f6

View File

@@ -509,7 +509,6 @@ class server_del(LDAPDelete):
if self.api.Command.ca_is_enabled()['result']:
try:
roles = self.api.Command.server_role_find(
server_server=hostname,
role_servrole='KRA server',
status='enabled',
include_master=True,