summaryrefslogtreecommitdiff
path: root/source4/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'source4/scripting')
-rw-r--r--source4/scripting/python/pyglue.c48
-rw-r--r--source4/scripting/python/samba/__init__.py2
2 files changed, 1 insertions, 49 deletions
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c
index 8dc80505d6..ce164a7085 100644
--- a/source4/scripting/python/pyglue.c
+++ b/source4/scripting/python/pyglue.c
@@ -46,25 +46,6 @@
} */\
ldb = PyLdb_AsLdbContext(py_ldb);
-static void PyErr_SetLdbError(PyObject *error, int ret, struct ldb_context *ldb_ctx)
-{
- if (ret == LDB_ERR_PYTHON_EXCEPTION)
- return; /* Python exception should already be set, just keep that */
-
- PyErr_SetObject(error,
- Py_BuildValue(discard_const_p(char, "(i,s)"), ret,
- ldb_ctx == NULL?ldb_strerror(ret):ldb_errstring(ldb_ctx)));
-}
-
-static PyObject *py_ldb_get_exception(void)
-{
- PyObject *mod = PyImport_ImportModule("ldb");
- if (mod == NULL)
- return NULL;
-
- return PyObject_GetAttrString(mod, "LdbError");
-}
-
static PyObject *py_generate_random_str(PyObject *self, PyObject *args)
{
int len;
@@ -174,33 +155,6 @@ static PyObject *py_dsdb_write_prefixes_from_schema_to_ldb(PyObject *self, PyObj
Py_RETURN_NONE;
}
-static PyObject *py_dsdb_set_schema_from_ldb(PyObject *self, PyObject *args)
-{
- PyObject *py_ldb;
- struct ldb_context *ldb;
- PyObject *py_from_ldb;
- struct ldb_context *from_ldb;
- struct dsdb_schema *schema;
- int ret;
- if (!PyArg_ParseTuple(args, "OO", &py_ldb, &py_from_ldb))
- return NULL;
-
- PyErr_LDB_OR_RAISE(py_ldb, ldb);
-
- PyErr_LDB_OR_RAISE(py_from_ldb, from_ldb);
-
- schema = dsdb_get_schema(from_ldb, NULL);
- if (!schema) {
- PyErr_SetString(PyExc_RuntimeError, "Failed to set find a schema on 'from' ldb!\n");
- return NULL;
- }
-
- ret = dsdb_reference_schema(ldb, schema, true);
- PyErr_LDB_ERROR_IS_ERR_RAISE(py_ldb_get_exception(), ret, ldb);
-
- Py_RETURN_NONE;
-}
-
/*
return the list of interface IPs we have configured
takes an loadparm context, returns a list of IPs in string form
@@ -270,8 +224,6 @@ static PyMethodDef py_misc_methods[] = {
"nttime2string(nttime) -> string" },
{ "dsdb_write_prefixes_from_schema_to_ldb", (PyCFunction)py_dsdb_write_prefixes_from_schema_to_ldb, METH_VARARGS,
NULL },
- { "dsdb_set_schema_from_ldb", (PyCFunction)py_dsdb_set_schema_from_ldb, METH_VARARGS,
- NULL },
{ "set_debug_level", (PyCFunction)py_set_debug_level, METH_VARARGS,
"set debug level" },
{ "interface_ips", (PyCFunction)py_interface_ips, METH_VARARGS,
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index d03cdc13a5..2f125e6ba7 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -284,7 +284,7 @@ class Ldb(_Ldb):
return dsdb.dsdb_get_oid_from_attid(self, attid)
def set_schema_from_ldb(self, ldb):
- _glue.dsdb_set_schema_from_ldb(self, ldb)
+ dsdb.dsdb_set_schema_from_ldb(self, ldb)
def write_prefixes_from_schema(self):
_glue.dsdb_write_prefixes_from_schema_to_ldb(self)