Fixed a bug caused by a typo. Infrastructure role didn't work.
[ira/wip.git] / source4 / scripting / python / uuidmodule.c
index 9ae432dfa5b82c6be97ebf3b874a5899ce759c3f..3bfe0162cacefd13a00a8a5df28ed09469443e0a 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
 
+#include <Python.h>
 #include "includes.h"
-#include "Python.h"
 #include "librpc/ndr/libndr.h"
 
 static PyObject *uuid_random(PyObject *self, PyObject *args)
 {
        struct GUID guid;
+       PyObject *pyobj;
        char *str;
 
        if (!PyArg_ParseTuple(args, ""))
@@ -37,21 +38,21 @@ static PyObject *uuid_random(PyObject *self, PyObject *args)
                return NULL;
        }
 
+       pyobj = PyString_FromString(str);
+
        talloc_free(str);
 
-       return PyString_FromString(str);
+       return pyobj;
 }
 
 static PyMethodDef methods[] = {
-       { "random", (PyCFunction)uuid_random, METH_VARARGS, NULL},
+       { "uuid4", (PyCFunction)uuid_random, METH_VARARGS, NULL},
        { NULL, NULL }
 };
 
-PyDoc_STRVAR(param_doc, "UUID helper routines");
-
-PyMODINIT_FUNC inituuid(void)
+void inituuid(void)
 {
-       PyObject *mod = Py_InitModule3("uuid", methods, param_doc);
+       PyObject *mod = Py_InitModule3("uuid", methods, "UUID helper routines");
        if (mod == NULL)
                return;
 }