Skip to content

Commit 4589c4d

Browse files
mgr: do not require NOTIFY_TYPES in python modules
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]>
1 parent 6e630c4 commit 4589c4d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mgr/PyModule.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,8 +515,8 @@ int PyModule::load_notify_types()
515515
{
516516
PyObject *ls = PyObject_GetAttrString(pClass, "NOTIFY_TYPES");
517517
if (ls == nullptr) {
518-
derr << "Module " << get_name() << " has missing NOTIFY_TYPES member" << dendl;
519-
return -EINVAL;
518+
dout(10) << "Module " << get_name() << " has no NOTIFY_TYPES member" << dendl;
519+
return 0;
520520
}
521521
if (!PyObject_TypeCheck(ls, &PyList_Type)) {
522522
// Relatively easy mistake for human to make, e.g. defining COMMANDS

0 commit comments

Comments
 (0)