mirror of
https://github.com/samba-team/samba.git
synced 2025-07-20 08:59:06 +03:00
s4-samba-tool: fixed exception handling in subcommands
this switches to the new pattern of: except Exception, e: raise CommandError("some error message", e)
This commit is contained in:
@ -65,9 +65,8 @@ class cmd_acl_set(Command):
|
||||
try:
|
||||
ldb = Ldb(path, session_info=system_session(), credentials=creds,
|
||||
lp=lp)
|
||||
except:
|
||||
# XXX: Should catch a particular exception type
|
||||
raise CommandError("Unable to read domain SID from configuration files")
|
||||
except Exception, e:
|
||||
raise CommandError("Unable to read domain SID from configuration files", e)
|
||||
attrs = ["objectSid"]
|
||||
print lp.get("realm")
|
||||
res = ldb.search(expression="(objectClass=*)",
|
||||
|
Reference in New Issue
Block a user