From 9f5dcb2235b42177bc325a48930917b5d68308e4 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 27 Aug 2010 12:08:49 +1000 Subject: s4-net: use CommandError() in net rodc this integrates better with the net command Pair-Programmed-With: Jelmer Vernooij --- source4/scripting/python/samba/netcmd/rodc.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/netcmd/rodc.py b/source4/scripting/python/samba/netcmd/rodc.py index 8e3ebbf66d..0fdb252b60 100644 --- a/source4/scripting/python/samba/netcmd/rodc.py +++ b/source4/scripting/python/samba/netcmd/rodc.py @@ -104,18 +104,18 @@ class cmd_rodc_preload(Command): local_samdb.transaction_start() repl = drs_Replicate("ncacn_ip_tcp:%s[seal,print]" % server, lp, creds, local_samdb) try: - repl.replicate(dn, source_dsa_invocation_id, destination_dsa_guid, exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET) + repl.replicate(dn, source_dsa_invocation_id, destination_dsa_guid, + exop=drsuapi.DRSUAPI_EXOP_REPL_SECRET) except RuntimeError, (ecode, estring): if estring == 'WERR_DS_DRA_ACCESS_DENIED': - print "Access denied replicating DN %s" % dn local_samdb.transaction_cancel() - # how do we fail a net command?? - return False + raise CommandError("Access denied replicating DN %s" % dn) else: raise local_samdb.transaction_commit() + class cmd_rodc(SuperCommand): """RODC commands""" -- cgit