Browse Source

[2379] Cleanup some docs and variables

Jelte Jansen 12 years ago
parent
commit
c9a786613e

+ 2 - 3
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<const s_DataSourceClient*>(client_obj);
+    s_DataSourceClient* client = static_cast<s_DataSourceClient*>(client_obj);
     return (*client->client);
 }
 

+ 8 - 0
src/lib/python/isc/datasrc/client_python.h

@@ -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);
 

+ 5 - 2
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;