From 7c5ee4e8fc19e5f5ac4076430d571cd60c51fb12 Mon Sep 17 00:00:00 2001 From: Petr Vobornik Date: May 15 2018 18:15:34 +0000 Subject: server-del do not return early if CA renewal master cannot be changed Early return prevented adding last warning message in the method: "Ignoring these warnings and proceeding with removal" And thus `check_master_removal` in `test_server_del` did not work. https://pagure.io/freeipa/issue/7517 Signed-off-by: Petr Vobornik Reviewed-By: Florence Blanc-Renaud --- diff --git a/ipaserver/plugins/server.py b/ipaserver/plugins/server.py index 59e611f..4ea6f5b 100644 --- a/ipaserver/plugins/server.py +++ b/ipaserver/plugins/server.py @@ -523,16 +523,13 @@ class server_del(LDAPDelete): "leave your installation without a CA."), ignore_last_of_role) + # change the renewal master if there is other master with CA if ca_renewal_master == hostname: other_cas = [ca for ca in ca_servers if ca != hostname] - # if this is the last CA there is no other server to become - # renewal master - if not other_cas: - return - - self.api.Command.config_mod( - ca_renewal_master_server=other_cas[0]) + if other_cas: + self.api.Command.config_mod( + ca_renewal_master_server=other_cas[0]) if ignore_last_of_role: self.add_message(