1
0
mirror of https://github.com/samba-team/samba.git synced 2025-07-27 07:42:04 +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

@ -106,12 +106,8 @@ class cmd_rodc_preload(Command):
try:
repl.replicate(dn, source_dsa_invocation_id, destination_dsa_guid,
exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET, rodc=True)
except RuntimeError, (ecode, estring):
if estring == 'WERR_DS_DRA_ACCESS_DENIED':
local_samdb.transaction_cancel()
raise CommandError("Access denied replicating DN %s" % dn)
else:
raise
except Exception, e:
raise CommandError("Error replicating DN %s" % dn, e)
local_samdb.transaction_commit()