]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: improve logging on handle_command path
authorJohn Spray <john.spray@redhat.com>
Tue, 15 May 2018 22:13:51 +0000 (23:13 +0100)
committerJohn Spray <john.spray@redhat.com>
Fri, 6 Jul 2018 10:01:20 +0000 (11:01 +0100)
Signed-off-by: John Spray <john.spray@redhat.com>
src/mgr/ActivePyModule.cc

index 42ad021d02d1b22ea3682ebd9419acbce9614109..c89334e08a35b6161db07a80fd6706cb52d5ee06 100644 (file)
@@ -135,6 +135,8 @@ int ActivePyModule::handle_command(
   int r = 0;
   if (pResult != NULL) {
     if (PyTuple_Size(pResult) != 3) {
+      derr << "module '" << py_module->get_name() << "' command handler "
+              "returned wrong type!" << dendl;
       r = -EINVAL;
     } else {
       r = PyInt_AsLong(PyTuple_GetItem(pResult, 0));
@@ -144,6 +146,8 @@ int ActivePyModule::handle_command(
 
     Py_DECREF(pResult);
   } else {
+    derr << "module '" << py_module->get_name() << "' command handler "
+            "threw exception: " << peek_pyerror() << dendl;
     *ds << "";
     *ss << handle_pyerror();
     r = -EINVAL;