plugin loader fix existing config testing (#78859)

create specific function to find config entry to avoid repopulating constantly
pull/78798/head
Brian Coca 2 years ago committed by GitHub
parent 71adb02142
commit 4115ddd135
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- plugin loader, fix detection for existing configuration before initializing for a plugin

@ -383,6 +383,14 @@ class ConfigManager(object):
return ret
def has_configuration_definition(self, plugin_type, name):
has = False
if plugin_type in self._plugins:
has = (name in self._plugins[plugin_type])
return has
def get_configuration_definitions(self, plugin_type=None, name=None, ignore_private=False):
''' just list the possible settings, either base or for specific plugins or plugin '''

@ -399,7 +399,7 @@ class PluginLoader:
type_name = get_plugin_class(self.class_name)
# if type name != 'module_doc_fragment':
if type_name in C.CONFIGURABLE_PLUGINS and not C.config.get_configuration_definition(type_name, name):
if type_name in C.CONFIGURABLE_PLUGINS and not C.config.has_configuration_definition(type_name, name):
dstring = AnsibleLoader(getattr(module, 'DOCUMENTATION', ''), file_name=path).get_single_data()
# TODO: allow configurable plugins to use sidecar

Loading…
Cancel
Save