mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10: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:
|
if options.list_managed_entries:
|
||||||
# List available Managed Entry Plugins
|
# List available Managed Entry Plugins
|
||||||
managed_entries = None
|
managed_entries = None
|
||||||
entries = conn.search_s(
|
try:
|
||||||
managed_entry_definitions_dn, ldap.SCOPE_SUBTREE, filter
|
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]
|
managed_entries = [entry.cn for entry in entries]
|
||||||
if managed_entries:
|
if managed_entries:
|
||||||
print "Available Managed Entry Definitions:"
|
print "Available Managed Entry Definitions:"
|
||||||
|
Loading…
Reference in New Issue
Block a user