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:
@ -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()
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user