Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package ceph for openSUSE:Factory checked in 
at 2025-08-25 20:36:32
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/ceph (Old)
 and      /work/SRC/openSUSE:Factory/.ceph.new.30751 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "ceph"

Mon Aug 25 20:36:32 2025 rev:103 rq:1301127 version:18.2.7

Changes:
--------
--- /work/SRC/openSUSE:Factory/ceph/ceph.changes        2025-07-22 
12:54:26.233398586 +0200
+++ /work/SRC/openSUSE:Factory/.ceph.new.30751/ceph.changes     2025-08-25 
20:37:16.730031625 +0200
@@ -1,0 +2,6 @@
+Sat Aug 23 13:05:12 UTC 2025 - James Oakley <jf...@opensuse.org>
+
+- Replace ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch with
+  more correct ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch
+
+-------------------------------------------------------------------

Old:
----
  ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch

New:
----
  ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch

----------(Old B)----------
  Old:
- Replace ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch with
  more correct ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch
----------(Old E)----------

----------(New B)----------
  New:- Replace ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch 
with
  more correct ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch
----------(New E)----------

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ ceph.spec ++++++
--- /var/tmp/diff_new_pack.oZopvG/_old  2025-08-25 20:37:18.138090613 +0200
+++ /var/tmp/diff_new_pack.oZopvG/_new  2025-08-25 20:37:18.142090781 +0200
@@ -212,11 +212,11 @@
 Patch8:         ceph-volume-fix-importlib.metadata-compat.patch
 # PATCH-FIX-UPSTREAM ceph-mgr-python-avoid-pyo3-errors.patch -- PR #62951
 Patch9:         ceph-mgr-python-avoid-pyo3-errors.patch
-# PATCH-FIX-UPSTREAM 
ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch -- 
4589c4d8ac524206d4fb6349b07c5a4e83f926dc
-Patch10:        ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch
+# PATCH-FIX-UPSTREAM 
ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch
+Patch10:        ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch
 # PATCH-FIX-OPENSUSE ceph-mgr-workaround-numpy-28271.patch -- Workaround for 
numpy #28271
 Patch11:        ceph-mgr-workaround-numpy-28271.patch
-# PATCH-FIX-UPSTREAM 
ceph-mgr-do-not-require-NOTIFY_TYPES-in-python-modules.patch -- PR #63952
+# PATCH-FIX-UPSTREAM 
cephadm-fix-get_cluster_count_when_data_dir_is_missing.patch -- PR #63952
 Patch12:        cephadm-fix-get_cluster_count_when_data_dir_is_missing.patch
 # PATCH-FIX-OPENSUSE ceph-rocksdb-gcc15.patch -- Fix gcc15 compatibility issues
 Patch13:        ceph-rocksdb-gcc15.patch

++++++ ceph-mgr-fix-module-import-by-making-NOTIFY_TYPES-in-py-m.patch ++++++
>From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Max R. Carrara" <m.carr...@proxmox.com>
Date: Wed, 16 Jul 2025 16:31:43 +0200
Subject: [PATCH 59/59] mgr: fix module import by making NOTIFY_TYPES in py
 modules optional

If NOTIFY_TYPES isn't an attribute of the passed class, the Python
(sub-)interpreter raises an AttributeError that must be handled or cleared
explicitly via the Python C-API. Unfortunately, this isn't done here,
which means that the exception sticks around until handled.

This caused a call to PyModule::load_subclass_of() to fail and
incorrectly report the AttributeError as cause.

Checking whether the class has NOTIFY_TYPES as attribute in the first
place fixes this.

Note that there's an upstream PR [0] that wasn't backported that aimed
to fix this, but does so incorrectly, as the exception is still not
cleared there. The warnings regarding NOTIFY_TYPES missing also occurs
on Reef but doesn't cause any module imports to fail there. As the
affected Ceph code has stayed mostly the same between bookworm and
trixie releases, this suggests that some behavior between Python 3.11
and 3.13 likely changed.

Either way, avoiding the AttributeError altogether fixes this.

[0]: https://github.com/ceph/ceph/pull/57106

Signed-off-by: Max R. Carrara <m.carr...@proxmox.com>
---
 src/mgr/PyModule.cc | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

--- a/src/mgr/PyModule.cc
+++ b/src/mgr/PyModule.cc
@@ -435,11 +435,13 @@ int PyModule::register_options(PyObject
 
 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;
+  if (!PyObject_HasAttrString(pClass, "NOTIFY_TYPES")) {
+    dout(10) << "Module " << get_name() << " has no NOTIFY_TYPES member" << 
dendl;
+    return 0;
   }
+
+  PyObject *ls = PyObject_GetAttrString(pClass, "NOTIFY_TYPES");
+
   if (!PyObject_TypeCheck(ls, &PyList_Type)) {
     // Relatively easy mistake for human to make, e.g. defining COMMANDS
     // as a {} instead of a []

Reply via email to