mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-13 09:41:55 -06:00
Fix dns_is_enabled() API command to throw exceptions as appropriate
Previously the command returned False whenever an exception occured which caused installed to continue even when there was a problem with LDAP connection. https://fedorahosted.org/freeipa/ticket/5564 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
aab190cc5d
commit
17a4a29c25
@ -4266,16 +4266,14 @@ class dns_is_enabled(Command):
|
|||||||
dns_enabled = False
|
dns_enabled = False
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ent = ldap.find_entries(filter=self.filter, base_dn=self.base_dn)
|
ldap.find_entries(filter=self.filter, base_dn=self.base_dn)
|
||||||
if len(ent):
|
dns_enabled = True
|
||||||
dns_enabled = True
|
except errors.EmptyResult:
|
||||||
except Exception as e:
|
dns_enabled = False
|
||||||
pass
|
|
||||||
|
|
||||||
return dict(result=dns_enabled, value=pkey_to_value(None, options))
|
return dict(result=dns_enabled, value=pkey_to_value(None, options))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@register()
|
@register()
|
||||||
class dnsconfig(LDAPObject):
|
class dnsconfig(LDAPObject):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user