]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[2379] Cleanup some docs and variables
authorJelte Jansen <jelte@isc.org>
Fri, 14 Dec 2012 13:29:40 +0000 (14:29 +0100)
committerJelte Jansen <jelte@isc.org>
Fri, 14 Dec 2012 17:33:33 +0000 (18:33 +0100)
src/lib/python/isc/datasrc/client_python.cc
src/lib/python/isc/datasrc/client_python.h
src/lib/python/isc/datasrc/zone_loader_python.cc

index 1c60c577fb88a5a09d1206c3fbea27fc3b7165a0..8fea173cca1e170c27dbc1782fe1991b43657b06 100644 (file)
@@ -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<const s_DataSourceClient*>(client_obj);
+    s_DataSourceClient* client = static_cast<s_DataSourceClient*>(client_obj);
     return (*client->client);
 }
 
index 09732ccbce1eb0acd2fb162301e3aa0ef1291336..e700fde9cf59a19037eba003a0cd9e89048f7e31 100644 (file)
@@ -44,6 +44,14 @@ wrapDataSourceClient(DataSourceClient* client,
                      LifeKeeper>& life_keeper = boost::shared_ptr<ClientList::
                      FindResult::LifeKeeper>());
 
+/// \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);
 
index b785d80fe0f26fd5de8c25a15412dac77b2e3ef6..92c589b0b0a5ff02d79a0a101856fcb787e134a6 100644 (file)
@@ -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;