From 2c22b441013975dc4f76b2095ced024382693022 Mon Sep 17 00:00:00 2001 From: Leonid Usov Date: Mon, 8 Jan 2024 17:37:20 +0200 Subject: [PATCH] doc: fixes for local dev builds Signed-off-by: Leonid Usov (cherry picked from commit 88fb668938f051b723c518a7faa6aa759bc39829) --- doc/.gitignore | 1 + doc/_ext/ceph_commands.py | 7 ++++--- doc/conf.py | 10 +++++++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/doc/.gitignore b/doc/.gitignore index 0c7c74746ae94..9ee3c337d0ab5 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,2 +1,3 @@ /overview.png /object_store.png +_build/ diff --git a/doc/_ext/ceph_commands.py b/doc/_ext/ceph_commands.py index 861a013ea5a48..3822a87929387 100644 --- a/doc/_ext/ceph_commands.py +++ b/doc/_ext/ceph_commands.py @@ -177,7 +177,7 @@ class Sig: @staticmethod def parse_args(args): - return [Sig._parse_arg_desc(arg) for arg in args.split()] + return [Sig._parse_arg_desc(arg) for arg in args] TEMPLATE = ''' @@ -358,8 +358,9 @@ class CephMgrCommands(Directive): 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 + if 'pybind_rgw_mod' in sys.modules: + 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 2a083fae0e84e..4fdc9a53b757f 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -13,9 +13,13 @@ 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 - +# it could be that ceph was built without RGW support +# e.g. in a local development environment +try: + pybind_rgw_mod = __import__('rgw', globals(), locals(), [], 0) + sys.modules['pybind_rgw_mod'] = pybind_rgw_mod +except Exception: + pass def parse_ceph_release(): with open(os.path.join(top_level, 'src/ceph_release')) as f: -- 2.39.5