From: Jelte Jansen Date: Fri, 14 Dec 2012 13:29:40 +0000 (+0100) Subject: [2379] Cleanup some docs and variables X-Git-Tag: bind10-1.0.0-beta-release~11^2^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9a786613ef05879fd0bcf88e6db0adf855e6ea1;p=thirdparty%2Fkea.git [2379] Cleanup some docs and variables --- diff --git a/src/lib/python/isc/datasrc/client_python.cc b/src/lib/python/isc/datasrc/client_python.cc index 1c60c577fb..8fea173cca 100644 --- a/src/lib/python/isc/datasrc/client_python.cc +++ b/src/lib/python/isc/datasrc/client_python.cc @@ -378,10 +378,9 @@ DataSourceClient& PyDataSourceClient_ToDataSourceClient(PyObject* client_obj) { if (client_obj == NULL) { isc_throw(PyCPPWrapperException, - "obj argument NULL in Name PyObject conversion"); + "argument NULL in DataSourceClient PyObject conversion"); } - const s_DataSourceClient* client = - static_cast(client_obj); + s_DataSourceClient* client = static_cast(client_obj); return (*client->client); } diff --git a/src/lib/python/isc/datasrc/client_python.h b/src/lib/python/isc/datasrc/client_python.h index 09732ccbce..e700fde9cf 100644 --- a/src/lib/python/isc/datasrc/client_python.h +++ b/src/lib/python/isc/datasrc/client_python.h @@ -44,6 +44,14 @@ wrapDataSourceClient(DataSourceClient* client, LifeKeeper>& life_keeper = boost::shared_ptr()); +/// \brief Returns a reference to the DataSourceClient object contained +/// in the given Python object. +/// +/// \note The given object MUST be of type DataSourceClient; this can be +/// checked with the right call to ParseTuple("O!") +/// +/// \param client_obj Python object holding the DataSourceClient +/// \return reference to the DataSourceClient object DataSourceClient& PyDataSourceClient_ToDataSourceClient(PyObject* client_obj); diff --git a/src/lib/python/isc/datasrc/zone_loader_python.cc b/src/lib/python/isc/datasrc/zone_loader_python.cc index b785d80fe0..92c589b0b0 100644 --- a/src/lib/python/isc/datasrc/zone_loader_python.cc +++ b/src/lib/python/isc/datasrc/zone_loader_python.cc @@ -62,6 +62,10 @@ ZoneLoader_init(PyObject* po_self, PyObject* args, PyObject*) { &po_target_client, &name_type, &po_name, &datasourceclient_type, &po_source_client) ) { + PyErr_SetString(PyExc_TypeError, + "Invalid arguments to ZoneLoader constructor, " + "expects isc.datasrc.DataSourceClient, isc.dns.Name, " + "and either a string or another DataSourceClient"); return (-1); } PyErr_Clear(); @@ -145,8 +149,7 @@ ZoneLoader_loadIncremental(PyObject* po_self, PyObject* args) { return (NULL); } try { - const bool complete = self->cppobj->loadIncremental(limit); - if (complete) { + if (self->cppobj->loadIncremental(limit)) { Py_RETURN_TRUE; } else { Py_RETURN_FALSE;