Avoid resolving module_paths for docs (#51453)

alternate to #51419
This commit is contained in:
Brian Coca 2019-02-18 15:51:49 -05:00 committed by GitHub
parent 8388c89a29
commit 5e9b089ec2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- when showing defaults for CLI options in manpage/docs/--help avoid converting paths

View file

@ -281,8 +281,10 @@ def add_meta_options(parser):
def add_module_options(parser): def add_module_options(parser):
"""Add options for commands that load modules""" """Add options for commands that load modules"""
module_path = C.config.get_configuration_definition('DEFAULT_MODULE_PATH').get('default', '')
parser.add_option('-M', '--module-path', dest='module_path', default=None, parser.add_option('-M', '--module-path', dest='module_path', default=None,
help="prepend colon-separated path(s) to module library (default=%s)" % C.DEFAULT_MODULE_PATH, help="prepend colon-separated path(s) to module library (default=%s)" % module_path,
action="callback", callback=unfrack_paths, type='str') action="callback", callback=unfrack_paths, type='str')

View file

@ -330,6 +330,18 @@ class ConfigManager(object):
pvars.append(var_entry['name']) pvars.append(var_entry['name'])
return pvars return pvars
def get_configuration_definition(self, name, plugin_type=None, plugin_name=None):
ret = {}
if plugin_type is None:
ret = self._base_defs.get(name, None)
elif plugin_name is None:
ret = self._plugins.get(plugin_type, {}).get(name, None)
else:
ret = self._plugins.get(plugin_type, {}).get(plugin_name, {}).get(name, None)
return ret
def get_configuration_definitions(self, plugin_type=None, name=None): def get_configuration_definitions(self, plugin_type=None, name=None):
''' just list the possible settings, either base or for specific plugins or plugin ''' ''' just list the possible settings, either base or for specific plugins or plugin '''