diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2008-05-24 21:38:33 +0200 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2008-05-24 21:38:33 +0200 |
commit | f9c36fae757d197ee4de06f0ecf94ae13faad0de (patch) | |
tree | 9c93537b32bc7b0748183b894c2a1e600a0eff76 /source4/scripting/python | |
parent | fe5be25547b5517ebc2e74d298921ae8c53650e5 (diff) | |
download | samba-f9c36fae757d197ee4de06f0ecf94ae13faad0de.tar.gz samba-f9c36fae757d197ee4de06f0ecf94ae13faad0de.tar.bz2 samba-f9c36fae757d197ee4de06f0ecf94ae13faad0de.zip |
Export functions for setting NTSTATUS and WERRORs in python.
(This used to be commit 4bcb92d2d49d90863b1e64b15d055517fbfd263c)
Diffstat (limited to 'source4/scripting/python')
-rw-r--r-- | source4/scripting/python/misc.i | 7 | ||||
-rw-r--r-- | source4/scripting/python/misc_wrap.c | 6 |
2 files changed, 7 insertions, 6 deletions
diff --git a/source4/scripting/python/misc.i b/source4/scripting/python/misc.i index 56b862552a..1d331215b5 100644 --- a/source4/scripting/python/misc.i +++ b/source4/scripting/python/misc.i @@ -35,7 +35,7 @@ %import "../../auth/credentials/credentials.i" %import "../../param/param.i" %import "../../libcli/security/security.i" -%import "../../libcli/util/errors.i" +%include "../../libcli/util/errors.i" %feature("docstring") generate_random_str "S.random_password(len) -> string\n" \ "Generate random password with specified length."; @@ -97,7 +97,6 @@ bool dsdb_set_ntds_invocation_id(struct ldb_context *ldb, const char *guid) } %} -char *private_path(TALLOC_CTX* mem_ctx, - struct loadparm_context *lp_ctx, - const char *name); +char *private_path(TALLOC_CTX* mem_ctx, struct loadparm_context *lp_ctx, + const char *name); diff --git a/source4/scripting/python/misc_wrap.c b/source4/scripting/python/misc_wrap.c index 8c57237e5b..888918ef53 100644 --- a/source4/scripting/python/misc_wrap.c +++ b/source4/scripting/python/misc_wrap.c @@ -2554,6 +2554,9 @@ static swig_module_info swig_module = {swig_types, 27, 0, 0, 0, 0}; #include "librpc/ndr/libndr.h" +#include "libcli/util/pyerrors.h" + + SWIGINTERN int SWIG_AsVal_double (PyObject *obj, double *val) { @@ -3046,8 +3049,7 @@ SWIGINTERN PyObject *_wrap_dsdb_attach_schema_from_ldif_file(PyObject *SWIGUNUSE "ldb context must be non-NULL"); result = dsdb_attach_schema_from_ldif_file(arg1,(char const *)arg2,(char const *)arg3); if (!W_ERROR_IS_OK(result)) { - PyObject *obj = Py_BuildValue((char *)"(i,s)", W_ERROR_V(result), win_errstr(result)); - PyErr_SetObject(PyExc_RuntimeError, obj); + PyErr_SetWERROR(result); SWIG_fail; } else if (resultobj == NULL) { resultobj = Py_None; |