Skip to content

Commit

Permalink
mgr: do not require NOTIFY_TYPES in python modules
Browse files Browse the repository at this point in the history
Many python mgr modules lack a NOTIFY_TYPES member apparently without
any downsides beyond an annoying message in the logs.  This includes
commonly used mgr modules like 'volumes' and 'cephadm'.  Stop emitting
an error for missing NOTIFY_TYPES by not assuming all mgr modules in
python should provide it. The return code is also changed to indicate
that this is not an error but the return from this function is never
checked and so it should have no impact. However, if someone started
using the return value in the future this would match the log change.

Fixes: https://tracker.ceph.com/issues/55835
Signed-off-by: John Mulligan <[email protected]>
  • Loading branch information
phlogistonjohn committed Apr 26, 2024
1 parent 6e630c4 commit 4589c4d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mgr/PyModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -515,8 +515,8 @@ int PyModule::load_notify_types()
{
PyObject *ls = PyObject_GetAttrString(pClass, "NOTIFY_TYPES");
if (ls == nullptr) {
derr << "Module " << get_name() << " has missing NOTIFY_TYPES member" << dendl;
return -EINVAL;
dout(10) << "Module " << get_name() << " has no NOTIFY_TYPES member" << dendl;
return 0;
}
if (!PyObject_TypeCheck(ls, &PyList_Type)) {
// Relatively easy mistake for human to make, e.g. defining COMMANDS
Expand Down

0 comments on commit 4589c4d

Please sign in to comment.