mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-23 07:33:27 -06:00
Don't fail if config-show does not return servers
When uninstalling a cluster and only hidden servers are left, config-show can return a result set without ipa_master_server entry. Fixes: https://pagure.io/freeipa/issue/7892 Signed-off-by: Christian Heimes <cheimes@redhat.com> Reviewed-By: Francois Cami <fcami@redhat.com> Reviewed-By: Thomas Woerner <twoerner@redhat.com>
This commit is contained in:
parent
d727321ce3
commit
713c9b0ce8
@ -125,7 +125,7 @@ def uninstall_check(options):
|
||||
|
||||
# skip the checks if the host is the last master
|
||||
ipa_config = api.Command.config_show()['result']
|
||||
ipa_masters = ipa_config['ipa_master_server']
|
||||
ipa_masters = ipa_config.get('ipa_master_server', [])
|
||||
if len(ipa_masters) <= 1:
|
||||
return
|
||||
|
||||
|
@ -91,7 +91,7 @@ class pkinit_status(Search):
|
||||
if server is not None:
|
||||
servers = [server]
|
||||
else:
|
||||
servers = ipa_master_config['ipa_master_server']
|
||||
servers = ipa_master_config.get('ipa_master_server', [])
|
||||
|
||||
pkinit_servers = ipa_master_config.get('pkinit_server_server')
|
||||
if pkinit_servers is None:
|
||||
|
@ -482,7 +482,7 @@ class server_del(LDAPDelete):
|
||||
|
||||
ipa_config = self.api.Command.config_show()['result']
|
||||
|
||||
ipa_masters = ipa_config['ipa_master_server']
|
||||
ipa_masters = ipa_config.get('ipa_master_server', [])
|
||||
|
||||
# skip these checks if the last master is being removed
|
||||
if len(ipa_masters) <= 1:
|
||||
|
Loading…
Reference in New Issue
Block a user