diff options
| author | Andrew Tridgell <tridge@samba.org> | 2010-11-29 14:15:57 +1100 |
|---|---|---|
| committer | Andrew Tridgell <tridge@samba.org> | 2010-11-29 18:04:42 +1100 |
| commit | 37bfc4ec384df71a4cb1c19ceb136fecd3b9afc6 (patch) | |
| tree | e44efedee115beac377d1fc9ab3a22c5e6cc2cee /source4/scripting/python/samba/netcmd/rodc.py | |
| parent | 62506903101e8e8e1cfc6c70fee245f97c646844 (diff) | |
| download | samba-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/netcmd/rodc.py')
| -rw-r--r-- | source4/scripting/python/samba/netcmd/rodc.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/source4/scripting/python/samba/netcmd/rodc.py b/source4/scripting/python/samba/netcmd/rodc.py index 5f97c32b282..b1f9d66d1fe 100644 --- a/source4/scripting/python/samba/netcmd/rodc.py +++ b/source4/scripting/python/samba/netcmd/rodc.py @@ -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() |
