From: Yehuda Sadeh Date: Mon, 29 Nov 2021 23:31:42 +0000 (-0800) Subject: doc/rgw: fix docs build X-Git-Tag: v17.1.0~340^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=50ab91473e9abed9823641facb1ffdb9309ac9ea;p=ceph.git doc/rgw: fix docs build Workaround rgw modules conflict, as there are two separate modules named rgw: src/pybind/rgw, src/pybind/mgr/rgw Signed-off-by: Yehuda Sadeh --- diff --git a/doc/_ext/ceph_commands.py b/doc/_ext/ceph_commands.py index 046a5e09c398c..861a013ea5a48 100644 --- a/doc/_ext/ceph_commands.py +++ b/doc/_ext/ceph_commands.py @@ -9,6 +9,7 @@ from jinja2 import Template from pcpp.preprocessor import Preprocessor from sphinx.util import logging from sphinx.util.console import bold +from importlib import reload logger = logging.getLogger(__name__) @@ -310,6 +311,7 @@ class CephMgrCommands(Directive): with self.mocked_modules(): logger.info(bold(f"loading mgr module '{name}'...")) mgr_mod = __import__(name, globals(), locals(), [], 0) + reload(mgr_mod) from tests import M def subclass(x): @@ -355,6 +357,10 @@ class CephMgrCommands(Directive): cmds = [cmd for cmd in cmds if 'hidden' not in cmd.flags] cmds = sorted(cmds, key=lambda cmd: cmd.prefix) self._render_cmds(cmds) + + orig_rgw_mod = sys.modules['pybind_rgw_mod'] + sys.modules['rgw'] = orig_rgw_mod + return [] diff --git a/doc/conf.py b/doc/conf.py index 690843a74ff96..c4d5bfb49c684 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,6 +13,9 @@ top_level = \ os.path.dirname( os.path.abspath(__file__))) +pybind_rgw_mod = __import__('rgw', globals(), locals(), [], 0) +sys.modules['pybind_rgw_mod'] = pybind_rgw_mod + def parse_ceph_release(): with open(os.path.join(top_level, 'src/ceph_release')) as f: