[SCM] Samba Shared Repository - branch master updated

Jelmer Vernooij jelmer at samba.org
Thu Mar 1 15:07:02 MST 2012


The branch, master has been updated
       via  e29a9f4 pyldb: Avoid using PyErr_LDB_ERROR_IS_ERR_RAISE where PyErr_SetLdbError suffices.
      from  f5f17b1 dlz_bind9: Match PTR records as DNS names and not just strings

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit e29a9f4af76f15030ba316690bdbb55806081fde
Author: Jelmer Vernooij <jelmer at samba.org>
Date:   Thu Mar 1 21:26:27 2012 +0100

    pyldb: Avoid using PyErr_LDB_ERROR_IS_ERR_RAISE where PyErr_SetLdbError suffices.
    
    Autobuild-User: Jelmer Vernooij <jelmer at samba.org>
    Autobuild-Date: Thu Mar  1 23:06:55 CET 2012 on sn-devel-104

-----------------------------------------------------------------------

Summary of changes:
 lib/ldb/pyldb.c |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index 2f99d14..a2a5dff 100644
--- a/lib/ldb/pyldb.c
+++ b/lib/ldb/pyldb.c
@@ -922,7 +922,8 @@ static PyObject *py_ldb_connect(PyLdbObject *self, PyObject *args, PyObject *kwa
 	ret = ldb_connect(pyldb_Ldb_AsLdbContext(self), url, flags, options);
 	talloc_free(options);
 
-	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, pyldb_Ldb_AsLdbContext(self));
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret,
+								 pyldb_Ldb_AsLdbContext(self));
 
 	Py_RETURN_NONE;
 }
@@ -970,7 +971,7 @@ static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args, PyObject *kwar
 	if (validate) {
 		ret = ldb_msg_sanity_check(ldb_ctx, msg);
 		if (ret != LDB_SUCCESS) {
-			PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+			PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
 			talloc_free(mem_ctx);
 			return NULL;
 		}
@@ -990,7 +991,8 @@ static PyObject *py_ldb_modify(PyLdbObject *self, PyObject *args, PyObject *kwar
 	ret = ldb_transaction_start(ldb_ctx);
 	if (ret != LDB_SUCCESS) {
 		talloc_free(mem_ctx);
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
+		return NULL;
 	}
 
 	ret = ldb_request(ldb_ctx, req);
@@ -1117,7 +1119,7 @@ static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args, PyObject *kwargs)
 
 	ret = ldb_msg_sanity_check(ldb_ctx, msg);
 	if (ret != LDB_SUCCESS) {
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
 		talloc_free(mem_ctx);
 		return NULL;
 	}
@@ -1136,7 +1138,8 @@ static PyObject *py_ldb_add(PyLdbObject *self, PyObject *args, PyObject *kwargs)
 	ret = ldb_transaction_start(ldb_ctx);
 	if (ret != LDB_SUCCESS) {
 		talloc_free(mem_ctx);
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
+		return NULL;
 	}
 
 	ret = ldb_request(ldb_ctx, req);
@@ -1207,7 +1210,8 @@ static PyObject *py_ldb_delete(PyLdbObject *self, PyObject *args, PyObject *kwar
 	ret = ldb_transaction_start(ldb_ctx);
 	if (ret != LDB_SUCCESS) {
 		talloc_free(mem_ctx);
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
+		return NULL;
 	}
 
 	ret = ldb_request(ldb_ctx, req);
@@ -1286,7 +1290,8 @@ static PyObject *py_ldb_rename(PyLdbObject *self, PyObject *args, PyObject *kwar
 	ret = ldb_transaction_start(ldb_ctx);
 	if (ret != LDB_SUCCESS) {
 		talloc_free(mem_ctx);
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
+		return NULL;
 	}
 
 	ret = ldb_request(ldb_ctx, req);
@@ -1565,7 +1570,7 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
 
 	if (ret != LDB_SUCCESS) {
 		talloc_free(mem_ctx);
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
 		return NULL;
 	}
 
@@ -1579,7 +1584,7 @@ static PyObject *py_ldb_search(PyLdbObject *self, PyObject *args, PyObject *kwar
 
 	if (ret != LDB_SUCCESS) {
 		talloc_free(mem_ctx);
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb_ctx);
+		PyErr_SetLdbError(PyExc_LdbError, ret, ldb_ctx);
 		return NULL;
 	}
 
@@ -1649,10 +1654,8 @@ static PyObject *py_ldb_sequence_number(PyLdbObject *self, PyObject *args)
 
 	ret = ldb_sequence_number(ldb, type, &value);
 
-	if (ret != LDB_SUCCESS) {
-		PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb);
-		return NULL;
-	}
+	PyErr_LDB_ERROR_IS_ERR_RAISE(PyExc_LdbError, ret, ldb);
+
 	return PyLong_FromLongLong(value);
 }
 static PyMethodDef py_ldb_methods[] = {


-- 
Samba Shared Repository


More information about the samba-cvs mailing list