From f8339bd9c01619c316acc7666d5dd9cb50465b5e Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Thu, 15 Nov 2018 17:15:28 -0500 Subject: [PATCH] fix bug in config mgr - use function that creates config slots as needed (cherry picked from commit 652da8255869944a99bc12389fae5cd111dc92d6) --- changelogs/fragments/cfg_mgr_fix.yml | 2 ++ lib/ansible/config/manager.py | 8 +------- 2 files changed, 3 insertions(+), 7 deletions(-) create mode 100644 changelogs/fragments/cfg_mgr_fix.yml diff --git a/changelogs/fragments/cfg_mgr_fix.yml b/changelogs/fragments/cfg_mgr_fix.yml new file mode 100644 index 0000000000..06f2716dea --- /dev/null +++ b/changelogs/fragments/cfg_mgr_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - configuration retrieval would fail on non primed plugins diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py index ab0db12926..6a7b388f37 100644 --- a/lib/ansible/config/manager.py +++ b/lib/ansible/config/manager.py @@ -363,14 +363,8 @@ class ConfigManager(object): # Note: sources that are lists listed in low to high precedence (last one wins) value = None origin = None - defs = {} - if plugin_type is None: - defs = self._base_defs - elif plugin_name is None: - defs = self._plugins[plugin_type] - else: - defs = self._plugins[plugin_type][plugin_name] + defs = self.get_configuration_definitions(plugin_type, plugin_name) if config in defs: # direct setting via plugin arguments, can set to None so we bypass rest of processing/defaults