pydsdb: Move write_prefixes_from_schema_to_ldb to pydsdb from pyglue.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 19 Jun 2010 15:15:26 +0000 (17:15 +0200)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 19 Jun 2010 20:46:43 +0000 (22:46 +0200)
source4/dsdb/pydsdb.c
source4/scripting/python/pyglue.c
source4/scripting/python/samba/__init__.py

index 8f9ed9fa77baf6dd1e01bc855af0c2104cc16f57..a911afc8e69b6ef252e4d5eebf81b911b8638e15 100644 (file)
@@ -435,6 +435,30 @@ static PyObject *py_dsdb_set_schema_from_ldb(PyObject *self, PyObject *args)
        Py_RETURN_NONE;
 }
 
+static PyObject *py_dsdb_write_prefixes_from_schema_to_ldb(PyObject *self, PyObject *args)
+{
+       PyObject *py_ldb;
+       struct ldb_context *ldb;
+       WERROR result;
+       struct dsdb_schema *schema;
+
+       if (!PyArg_ParseTuple(args, "O", &py_ldb))
+               return NULL;
+
+       PyErr_LDB_OR_RAISE(py_ldb, ldb);
+
+       schema = dsdb_get_schema(ldb, NULL);
+       if (!schema) {
+               PyErr_SetString(PyExc_RuntimeError, "Failed to set find a schema on ldb!\n");
+               return NULL;
+       }
+
+       result = dsdb_write_prefixes_from_schema_to_ldb(NULL, ldb, schema);
+       PyErr_WERROR_IS_ERR_RAISE(result);
+
+       Py_RETURN_NONE;
+}
+
 
 
 static PyMethodDef py_dsdb_methods[] = {
@@ -477,6 +501,8 @@ static PyMethodDef py_dsdb_methods[] = {
                NULL },
        { "dsdb_set_schema_from_ldb", (PyCFunction)py_dsdb_set_schema_from_ldb, METH_VARARGS,
                NULL },
+       { "dsdb_write_prefixes_from_schema_to_ldb", (PyCFunction)py_dsdb_write_prefixes_from_schema_to_ldb, METH_VARARGS,
+               NULL },
        { NULL }
 };
 
index ce164a708569ce9094547824e073d6bf9f125b9e..5df1b9de6ff5f6acd5eb57f7ac07c822f18074e8 100644 (file)
@@ -131,30 +131,6 @@ static PyObject *py_set_debug_level(PyObject *self, PyObject *args)
 
 
 
-static PyObject *py_dsdb_write_prefixes_from_schema_to_ldb(PyObject *self, PyObject *args)
-{
-       PyObject *py_ldb;
-       struct ldb_context *ldb;
-       WERROR result;
-       struct dsdb_schema *schema;
-
-       if (!PyArg_ParseTuple(args, "O", &py_ldb))
-               return NULL;
-
-       PyErr_LDB_OR_RAISE(py_ldb, ldb);
-
-       schema = dsdb_get_schema(ldb, NULL);
-       if (!schema) {
-               PyErr_SetString(PyExc_RuntimeError, "Failed to set find a schema on ldb!\n");
-               return NULL;
-       }
-
-       result = dsdb_write_prefixes_from_schema_to_ldb(NULL, ldb, schema);
-       PyErr_WERROR_IS_ERR_RAISE(result);
-
-       Py_RETURN_NONE;
-}
-
 /*
   return the list of interface IPs we have configured
   takes an loadparm context, returns a list of IPs in string form
@@ -222,8 +198,6 @@ static PyMethodDef py_misc_methods[] = {
                "nttime2unix(nttime) -> timestamp" },
        { "nttime2string", (PyCFunction)py_nttime2string, METH_VARARGS,
                "nttime2string(nttime) -> string" },
-       { "dsdb_write_prefixes_from_schema_to_ldb", (PyCFunction)py_dsdb_write_prefixes_from_schema_to_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,
index 2f125e6ba76dd5f3ac23ce2e2c5f9943a5c23529..c8ce6b0af0695863fb878d69b95fcde00a698718 100644 (file)
@@ -287,7 +287,7 @@ class Ldb(_Ldb):
         dsdb.dsdb_set_schema_from_ldb(self, ldb)
 
     def write_prefixes_from_schema(self):
-        _glue.dsdb_write_prefixes_from_schema_to_ldb(self)
+        dsdb.dsdb_write_prefixes_from_schema_to_ldb(self)
 
     def convert_schema_to_openldap(self, target, mapping):
         return dsdb.dsdb_convert_schema_to_openldap(self, target, mapping)