#include "MgrPyModule.h"
+// FIXME: import sanely
+extern std::string handle_pyerror(void);
#define dout_context g_ceph_context
#define dout_subsys ceph_subsys_mgr
if (pValue != NULL) {
Py_DECREF(pValue);
} else {
- derr << "Failed to invoke serve() on " << module_name << dendl;
- PyErr_Print();
- r = -EINVAL;
+ derr << module_name << ".serve:" << dendl;
+ derr << handle_pyerror() << dendl;
+ return -EINVAL;
}
PyGILState_Release(gstate);
Py_DECREF(pValue);
} else {
derr << "Failed to invoke shutdown() on " << module_name << dendl;
- PyErr_Print();
+ derr << handle_pyerror() << dendl;
}
PyGILState_Release(gstate);
if (pValue != NULL) {
Py_DECREF(pValue);
} else {
- derr << "Failed to invoke notify() on " << module_name << dendl;
- PyErr_Print();
+ derr << module_name << ".notify:" << dendl;
+ derr << handle_pyerror() << dendl;
// FIXME: callers can't be expected to handle a python module
// that has spontaneously broken, but Mgr() should provide
// a hook to unload misbehaving modules when they have an
if (pValue != NULL) {
Py_DECREF(pValue);
} else {
- PyErr_Print();
+ derr << module_name << ".notify_clog:" << dendl;
+ derr << handle_pyerror() << dendl;
// FIXME: callers can't be expected to handle a python module
// that has spontaneously broken, but Mgr() should provide
// a hook to unload misbehaving modules when they have an
Py_DECREF(pResult);
} else {
- derr << "Failed to invoke handle_command() on " << module_name << dendl;
- PyErr_Print();
+ *ds << "";
+ *ss << handle_pyerror();
r = -EINVAL;
}