1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-27 14:04:05 +03:00

s4-net: use CommandError() in net rodc

this integrates better with the net command

Pair-Programmed-With: Jelmer Vernooij <jelmer@samba.org>
This commit is contained in:
Andrew Tridgell 2010-08-27 12:08:49 +10:00
parent 768475d571
commit 9f5dcb2235

View File

@ -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"""