From e51256c7d58040eeee02fc189b55afbc58379f81 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 1 Nov 2016 16:09:20 +1300 Subject: [PATCH] python: Add DsExtendedError Exception This will be used for checking errors during a GetNCChanges EXOP like RID Set allocation. Signed-off-by: Andrew Bartlett Reviewed-by: Garming Sam BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398 --- python/pyglue.c | 8 ++++++++ python/samba/__init__.py | 1 + 2 files changed, 9 insertions(+) diff --git a/python/pyglue.c b/python/pyglue.c index 938a9f0ecf4..dbe7eb4ec69 100644 --- a/python/pyglue.c +++ b/python/pyglue.c @@ -27,6 +27,7 @@ void init_glue(void); static PyObject *PyExc_NTSTATUSError; static PyObject *PyExc_WERRORError; static PyObject *PyExc_HRESULTError; +static PyObject *PyExc_DsExtendedError; static PyObject *py_generate_random_str(PyObject *self, PyObject *args) { @@ -314,5 +315,12 @@ void init_glue(void) Py_INCREF(PyExc_HRESULTError); PyModule_AddObject(m, "HRESULTError", PyExc_HRESULTError); } + + PyExc_DsExtendedError = PyErr_NewException(discard_const_p(char, "samba.DsExtendedError"), PyExc_RuntimeError, NULL); + if (PyExc_DsExtendedError != NULL) { + Py_INCREF(PyExc_DsExtendedError); + PyModule_AddObject(m, "DsExtendedError", PyExc_DsExtendedError); + } + } diff --git a/python/samba/__init__.py b/python/samba/__init__.py index 8c75a48874b..5f915318093 100644 --- a/python/samba/__init__.py +++ b/python/samba/__init__.py @@ -403,3 +403,4 @@ is_ntvfs_fileserver_built = _glue.is_ntvfs_fileserver_built NTSTATUSError = _glue.NTSTATUSError HRESULTError = _glue.HRESULTError WERRORError = _glue.WERRORError +DsExtendedError = _glue.DsExtendedError