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 <pvoborni@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Petr Vobornik 2018-05-10 10:02:16 +02:00 committed by Rob Crittenden
parent 8328a555ae
commit 7c5ee4e8fc

View File

@ -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(