|
This doesn't work. Or rather it does, but badly and for reasons I didn't
understand.
To set the stage.
1. All mgr modules in src/pybind/mgr/*/module.py import a 'mgr_module'
2. This module is located at src/pybind/mgr_module.py
3. It imports a module, 'ceph_module' that **does not exist.**
I didn't understand how this could work, as the file even remotely
similiar is src/pybind/mgr/ceph_module.pyi -- note the 'i'. This is what
is called a "python interface file" and basically isn't something the
python runtime is aware of. It's only use is by static code checkers
like mypy (and presumably the IDEs of people that work in this code).
I, naively assumed that somehow previous python versions had mistaken
this file for a real module hence the previous patch, where I just
define the various symbols referenced from other modules.
This isn't the case. Instead, the C++ mgr daemon _at runtime_ injects
what is effectively a bridge module into the C++ defined ceph data
structures.
This, obviously doesn't work during testing, but the upstream does have
some interesting machinery in src/pybind/mgr/tests/__init__.py, though I
don't understand how it would propagate to other test suites, and very
clearly it hasn't worked for at least since 18.2.0 for our builds.
A future commit will properly fix this issue
|