]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
doc/_ext: add "module" option to confval
authorKefu Chai <kchai@redhat.com>
Mon, 10 May 2021 03:40:11 +0000 (11:40 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 11 May 2021 07:43:59 +0000 (15:43 +0800)
in addition to "mgr_module" directive, add the "module" option to
confval. this allows a certain option to specify its own module without
being nested in a "mgr_module" directive pair.

Signed-off-by: Kefu Chai <kchai@redhat.com>
doc/_ext/ceph_confval.py

index 8883f4f5d9be9c87e904998123c0a247c831285d..3d02559c190489b0851026fc889297aa2645a749 100644 (file)
@@ -199,7 +199,10 @@ class CephOption(ObjectDescription):
     required_arguments = 1
     optional_arguments = 0
     final_argument_whitespace = False
-    option_spec = {'default': directives.unchanged}
+    option_spec = {
+        'module': directives.unchanged,
+        'default': directives.unchanged
+    }
 
 
     doc_field_types = [
@@ -372,7 +375,8 @@ class CephOption(ObjectDescription):
         signode += addnodes.desc_name(sig, sig)
         # normalize whitespace like XRefRole does
         name = ws_re.sub(' ', sig)
-        cur_module = self.env.ref_context.get('ceph:module')
+        cur_module = self.options.get('module',
+                                      self.env.ref_context.get('ceph:module'))
         if cur_module:
             return '/'.join(['mgr', cur_module, name])
         else: