summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-06-19 16:52:09 +0200
committerJelmer Vernooij <jelmer@samba.org>2010-06-19 22:46:43 +0200
commit05b108a06b383f2172a379629b9a6bcff82c6868 (patch)
treea8d1f657c27f0c0064f94b61048e71d3f9834254
parentd3a99579f6c87bf9bc5863ca645bc1456ee6834f (diff)
downloadsamba-05b108a06b383f2172a379629b9a6bcff82c6868.tar.gz
samba-05b108a06b383f2172a379629b9a6bcff82c6868.tar.bz2
samba-05b108a06b383f2172a379629b9a6bcff82c6868.zip
pydsdb: Move set_schema_from_ldif function to pydsdb from pyglue.
-rw-r--r--source4/dsdb/pydsdb.c20
-rw-r--r--source4/scripting/python/pyglue.c18
-rw-r--r--source4/scripting/python/samba/__init__.py2
3 files changed, 21 insertions, 19 deletions
diff --git a/source4/dsdb/pydsdb.c b/source4/dsdb/pydsdb.c
index fd6925d154..ce7923ddad 100644
--- a/source4/dsdb/pydsdb.c
+++ b/source4/dsdb/pydsdb.c
@@ -390,6 +390,24 @@ static PyObject *py_dsdb_set_am_rodc(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
+static PyObject *py_dsdb_set_schema_from_ldif(PyObject *self, PyObject *args)
+{
+ WERROR result;
+ char *pf, *df;
+ PyObject *py_ldb;
+ struct ldb_context *ldb;
+
+ if (!PyArg_ParseTuple(args, "Oss", &py_ldb, &pf, &df))
+ return NULL;
+
+ PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
+ result = dsdb_set_schema_from_ldif(ldb, pf, df);
+ PyErr_WERROR_IS_ERR_RAISE(result);
+
+ Py_RETURN_NONE;
+}
+
static PyMethodDef py_dsdb_methods[] = {
{ "samdb_server_site_name", (PyCFunction)py_samdb_server_site_name,
METH_VARARGS, "Get the server site name as a string"},
@@ -426,6 +444,8 @@ static PyMethodDef py_dsdb_methods[] = {
{ "dsdb_set_am_rodc",
(PyCFunction)py_dsdb_set_am_rodc, METH_VARARGS,
NULL },
+ { "dsdb_set_schema_from_ldif", (PyCFunction)py_dsdb_set_schema_from_ldif, METH_VARARGS,
+ NULL },
{ NULL }
};
diff --git a/source4/scripting/python/pyglue.c b/source4/scripting/python/pyglue.c
index e1c4feaf16..8dc80505d6 100644
--- a/source4/scripting/python/pyglue.c
+++ b/source4/scripting/python/pyglue.c
@@ -148,23 +148,7 @@ static PyObject *py_set_debug_level(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
-static PyObject *py_dsdb_set_schema_from_ldif(PyObject *self, PyObject *args)
-{
- WERROR result;
- char *pf, *df;
- PyObject *py_ldb;
- struct ldb_context *ldb;
- if (!PyArg_ParseTuple(args, "Oss", &py_ldb, &pf, &df))
- return NULL;
-
- PyErr_LDB_OR_RAISE(py_ldb, ldb);
-
- result = dsdb_set_schema_from_ldif(ldb, pf, df);
- PyErr_WERROR_IS_ERR_RAISE(result);
-
- Py_RETURN_NONE;
-}
static PyObject *py_dsdb_write_prefixes_from_schema_to_ldb(PyObject *self, PyObject *args)
{
@@ -284,8 +268,6 @@ static PyMethodDef py_misc_methods[] = {
"nttime2unix(nttime) -> timestamp" },
{ "nttime2string", (PyCFunction)py_nttime2string, METH_VARARGS,
"nttime2string(nttime) -> string" },
- { "dsdb_set_schema_from_ldif", (PyCFunction)py_dsdb_set_schema_from_ldif, METH_VARARGS,
- NULL },
{ "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,
diff --git a/source4/scripting/python/samba/__init__.py b/source4/scripting/python/samba/__init__.py
index ce408de049..d03cdc13a5 100644
--- a/source4/scripting/python/samba/__init__.py
+++ b/source4/scripting/python/samba/__init__.py
@@ -278,7 +278,7 @@ class Ldb(_Ldb):
dsdb.samdb_get_domain_sid(self)
def set_schema_from_ldif(self, pf, df):
- _glue.dsdb_set_schema_from_ldif(self, pf, df)
+ dsdb.dsdb_set_schema_from_ldif(self, pf, df)
def get_oid_from_attid(self, attid):
return dsdb.dsdb_get_oid_from_attid(self, attid)