summaryrefslogtreecommitdiff
path: root/source4/scripting/python/samba/samdb.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/samdb.py
parent62506903101e8e8e1cfc6c70fee245f97c646844 (diff)
downloadsamba-37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6.tar.gz
samba-37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6.tar.bz2
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/samdb.py')
-rw-r--r--source4/scripting/python/samba/samdb.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/source4/scripting/python/samba/samdb.py b/source4/scripting/python/samba/samdb.py
index 43b1938a0e..67e77e303b 100644
--- a/source4/scripting/python/samba/samdb.py
+++ b/source4/scripting/python/samba/samdb.py
@@ -169,7 +169,7 @@ pwdLastSet: 0
raise Exception('Unable to find group "%s"' % groupname)
assert(len(targetgroup) == 1)
self.delete(targetgroup[0].dn)
- except:
+ except Exception:
self.transaction_cancel()
raise
else:
@@ -225,7 +225,7 @@ member: %s
if modified is True:
self.modify_ldif(addtargettogroup)
- except:
+ except Exception:
self.transaction_cancel()
raise
else:
@@ -351,7 +351,7 @@ member: %s
if setpassword:
self.setpassword("(samAccountName=%s)" % username, password,
force_password_change_at_next_login_req)
- except:
+ except Exception:
self.transaction_cancel()
raise
else:
@@ -389,7 +389,7 @@ unicodePwd:: %s
# modify the userAccountControl to remove the disabled bit
self.enable_account(search_filter)
- except:
+ except Exception:
self.transaction_cancel()
raise
else:
@@ -430,7 +430,7 @@ accountExpires: %u
""" % (user_dn, userAccountControl, accountExpires)
self.modify_ldif(setexp)
- except:
+ except Exception:
self.transaction_cancel()
raise
else: