summaryrefslogtreecommitdiffstats
path: root/source4/scripting/python/samba/netcmd/newuser.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-11-29 14:15:57 +1100
committerAndrew Tridgell <tridge@samba.org>2010-11-29 18:04:42 +1100
commit37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6 (patch)
treee44efedee115beac377d1fc9ab3a22c5e6cc2cee /source4/scripting/python/samba/netcmd/newuser.py
parent62506903101e8e8e1cfc6c70fee245f97c646844 (diff)
downloadsamba-37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6.tar.gz
samba-37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6.tar.xz
samba-37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6.zip
s4-samba-tool: fixed exception handling in subcommands
this switches to the new pattern of: except Exception, e: raise CommandError("some error message", e)
Diffstat (limited to 'source4/scripting/python/samba/netcmd/newuser.py')
-rw-r--r--source4/scripting/python/samba/netcmd/newuser.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/source4/scripting/python/samba/netcmd/newuser.py b/source4/scripting/python/samba/netcmd/newuser.py
index 693568dee27..05c7bfc1bbf 100644
--- a/source4/scripting/python/samba/netcmd/newuser.py
+++ b/source4/scripting/python/samba/netcmd/newuser.py
@@ -91,7 +91,6 @@ class cmd_newuser(Command):
jobtitle=job_title, department=department, company=company, description=description,
mailaddress=mail_address, internetaddress=internet_address,
telephonenumber=telephone_number, physicaldeliveryoffice=physical_delivery_office)
- except ldb.LdbError, (num, msg):
- raise CommandError('Failed to create user "%s" : %s' % (
- username, msg))
+ except Exception, e:
+ raise CommandError('Failed to create user "%s"' % username, e)