1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-06 08:59:08 +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:
Andrew Tridgell
2010-11-29 14:15:57 +11:00
parent 6250690310
commit 37bfc4ec38
13 changed files with 68 additions and 74 deletions

View File

@ -91,22 +91,22 @@ class ProvisionLDB(object):
ok = True
try:
self.sam.transaction_cancel()
except:
except Exception:
ok = False
try:
self.secrets.transaction_cancel()
except:
except Exception:
ok = False
try:
self.idmap.transaction_cancel()
except:
except Exception:
ok = False
try:
self.privilege.transaction_cancel()
except:
except Exception:
ok = False
return ok
@ -122,7 +122,7 @@ class ProvisionLDB(object):
self.secrets.transaction_prepare_commit()
self.idmap.transaction_prepare_commit()
self.privilege.transaction_prepare_commit()
except:
except Exception:
return self.groupedRollback()
# TO BE DONE
# self.hkcr.transaction_prepare_commit()
@ -134,7 +134,7 @@ class ProvisionLDB(object):
self.secrets.transaction_commit()
self.idmap.transaction_commit()
self.privilege.transaction_commit()
except:
except Exception:
return self.groupedRollback()
# TO BE DONE
@ -688,13 +688,13 @@ def update_gpo(paths, samdb, names, lp, message, force=0):
try:
attribute = samba.xattr_tdb.wrap_getxattr(eadbname,
paths.sysvol, xattr.XATTR_NTACL_NAME)
except:
except Exception:
attribute = samba.xattr_native.wrap_getxattr(paths.sysvol,
xattr.XATTR_NTACL_NAME)
else:
attribute = samba.xattr_native.wrap_getxattr(paths.sysvol,
xattr.XATTR_NTACL_NAME)
except:
except Exception:
resetacls = True
if force: