summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2016-11-01 16:09:20 +1300
committerKarolin Seeger <kseeger@samba.org>2016-11-30 12:19:34 +0100
commitca5d70071fc4aec3ad1984f912eed9a28b8ae00f (patch)
tree8f1ecb2f45bd4c6cf876e7f12a566f6b48df528a
parent31d24bfb2a6954d43d179eeccd5070e64bc871fa (diff)
downloadsamba-ca5d70071fc4aec3ad1984f912eed9a28b8ae00f.tar.gz
python: Add DsExtendedError Exception
This will be used for checking errors during a GetNCChanges EXOP like RID Set allocation. Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Garming Sam <garming@catalyst.net.nz> BUG: https://bugzilla.samba.org/show_bug.cgi?id=12398 (cherry picked from commit e51256c7d58040eeee02fc189b55afbc58379f81)
-rw-r--r--python/pyglue.c8
-rw-r--r--python/samba/__init__.py1
2 files changed, 9 insertions, 0 deletions
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