From a82bc073e2e7dd5eef13c64ad219fa1179df8aa7 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 17 Nov 2010 11:09:59 +1100 Subject: s4-join: show a reasonable error on DsAddEntry() failing DsAddEntry() gives errors in a reply container --- source4/scripting/python/samba/join.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4') diff --git a/source4/scripting/python/samba/join.py b/source4/scripting/python/samba/join.py index 23ec845ea6..091b58c430 100644 --- a/source4/scripting/python/samba/join.py +++ b/source4/scripting/python/samba/join.py @@ -294,7 +294,12 @@ class dc_join: req2.first_object = first_object (level, ctr) = ctx.drsuapi.DsAddEntry(ctx.drsuapi_handle, 2, req2) - + if ctr.err_ver != 1: + raise RuntimeError("expected err_ver 1, got %u" % ctr.err_ver) + if ctr.err_data.status != (0, 'WERR_OK'): + print("DsAddEntry failed with status %s info %s" % (ctr.err_data.status, + ctr.err_data.info.extended_err)) + raise RuntimeError("DsAddEntry failed") def join_add_objects(ctx): '''add the various objects needed for the join''' -- cgit