mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 08:00:02 -06:00
Catch exception when trying to list missing managed entries definitions
On the off chance that the definitions cannot be found we should catch the error and not raise a backtrace. https://fedorahosted.org/freeipa/ticket/1912
This commit is contained in:
parent
64b0855e87
commit
638a970172
@ -127,9 +127,13 @@ def main():
|
||||
if options.list_managed_entries:
|
||||
# List available Managed Entry Plugins
|
||||
managed_entries = None
|
||||
entries = conn.search_s(
|
||||
managed_entry_definitions_dn, ldap.SCOPE_SUBTREE, filter
|
||||
)
|
||||
try:
|
||||
entries = conn.search_s(
|
||||
managed_entry_definitions_dn, ldap.SCOPE_SUBTREE, filter
|
||||
)
|
||||
except Exception, e:
|
||||
root_logger.debug("Search for managed entries failed: %s" % str(e))
|
||||
sys.exit("Unable to find managed entries at %s" % managed_entry_definitions_dn)
|
||||
managed_entries = [entry.cn for entry in entries]
|
||||
if managed_entries:
|
||||
print "Available Managed Entry Definitions:"
|
||||
|
Loading…
Reference in New Issue
Block a user