From 37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 29 Nov 2010 14:15:57 +1100 Subject: s4-samba-tool: fixed exception handling in subcommands this switches to the new pattern of: except Exception, e: raise CommandError("some error message", e) --- source4/scripting/python/samba/netcmd/ntacl.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source4/scripting/python/samba/netcmd/ntacl.py') diff --git a/source4/scripting/python/samba/netcmd/ntacl.py b/source4/scripting/python/samba/netcmd/ntacl.py index 83656587612..49f8fbc77f0 100644 --- a/source4/scripting/python/samba/netcmd/ntacl.py +++ b/source4/scripting/python/samba/netcmd/ntacl.py @@ -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=*)", -- cgit v1.2.3