From: Stefan Metzmacher Date: Fri, 25 May 2018 05:52:02 +0000 (+0200) Subject: python: export fault_setup() to python bindings X-Git-Tag: tevent-0.9.37~386 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3ddd8527104f7364c07816fd9d3f1039a396a2f9;p=thirdparty%2Fsamba.git python: export fault_setup() to python bindings BUG: https://bugzilla.samba.org/show_bug.cgi?id=13469 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/python/pyglue.c b/python/pyglue.c index 68b14a072e4..1b111866f22 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -170,6 +170,16 @@ static PyObject *py_get_debug_level(PyObject *self) return PyInt_FromLong(DEBUGLEVEL); } +static PyObject *py_fault_setup(PyObject *self) +{ + static bool done; + if (!done) { + fault_setup(); + done = true; + } + Py_RETURN_NONE; +} + static PyObject *py_is_ntvfs_fileserver_built(PyObject *self) { #ifdef WITH_NTVFS_FILESERVER @@ -339,6 +349,8 @@ static PyMethodDef py_misc_methods[] = { "set debug level" }, { "get_debug_level", (PyCFunction)py_get_debug_level, METH_NOARGS, "get debug level" }, + { "fault_setup", (PyCFunction)py_fault_setup, METH_NOARGS, + "setup the default samba panic handler" }, { "interface_ips", (PyCFunction)py_interface_ips, METH_VARARGS, "interface_ips(lp_ctx[, all_interfaces) -> list_of_ifaces\n" "\n" diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 7b3c6538771..1a3b24bca58 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -381,6 +381,7 @@ def arcfour_encrypt(key, data): version = _glue.version interface_ips = _glue.interface_ips +fault_setup = _glue.fault_setup set_debug_level = _glue.set_debug_level get_debug_level = _glue.get_debug_level unix2nttime = _glue.unix2nttime