From: Kefu Chai Date: Mon, 10 May 2021 03:41:58 +0000 (+0800) Subject: doc/_ext: do not load all modules for a certain module X-Git-Tag: v17.1.0~1986^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8c4c5eb8e184ec4eb9372f9e0367e683d5f5906e;p=ceph.git doc/_ext: do not load all modules for a certain module instead of collecting all options from all modules, just load the options from the specified module, this addresses the issue where options with the same name are overriden by the options defined by another mgr module. Signed-off-by: Kefu Chai --- diff --git a/doc/_ext/ceph_confval.py b/doc/_ext/ceph_confval.py index 3d02559c190..d824f384ef9 100644 --- a/doc/_ext/ceph_confval.py +++ b/doc/_ext/ceph_confval.py @@ -329,19 +329,13 @@ class CephOption(ObjectDescription): module_path = self.env.config.ceph_confval_mgr_module_path module_path = self._normalize_path(module_path) sys.path.insert(0, module_path) + if not self._is_mgr_module(module_path, module): + raise self.error(f'module "{module}" not found under {module_path}') + fn = os.path.join(module_path, module, 'module.py') + if os.path.exists(fn): + self.env.note_dependency(fn) os.environ['UNITTEST'] = 'true' - - modules = [name for name in os.listdir(module_path) - if self._is_mgr_module(module_path, name)] - opts = [] - for module in status_iterator(modules, - 'loading module...', 'darkgreen', - len(modules), - self.env.app.verbosity): - fn = os.path.join(module_path, module, 'module.py') - if os.path.exists(fn): - self.env.note_dependency(fn) - opts += self._collect_options_from_module(module) + opts = self._collect_options_from_module(module) CephOption.mgr_opts[module] = dict((opt['name'], opt) for opt in opts) return CephOption.mgr_opts[module]