summaryrefslogtreecommitdiff
path: root/lib/ansible/config
diff options
context:
space:
mode:
authorBrian Coca <brian.coca+git@gmail.com>2017-09-10 17:53:49 -0400
committerToshio Kuratomi <a.badger@gmail.com>2017-09-11 14:00:32 -0700
commit34db3cd9be16094bcc9ee958cb02a0243b361457 (patch)
treea70eb110d314632b05d790791ee05739923a401f /lib/ansible/config
parent61315cd3c5164b87d7885df9b56043025bd9b272 (diff)
downloadansible-34db3cd9be16094bcc9ee958cb02a0243b361457.tar.gz
allow config for callbaks and some fixes
* only complain about ini deprecation if value is set * set plugin config for stdout and other types * updated plugin docs, moved several plugins to new config * finished ssh docs * fixed some issues seen in plugins while modifying docs * placeholder for 'required' * callbacks must use _plugin_options as _options already in use (cherry picked from commit 869a31849224a8fff88364ceea3db9b3e6b475d7)
Diffstat (limited to 'lib/ansible/config')
-rw-r--r--lib/ansible/config/manager.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/ansible/config/manager.py b/lib/ansible/config/manager.py
index 545cb7c19b..5270a4fa66 100644
--- a/lib/ansible/config/manager.py
+++ b/lib/ansible/config/manager.py
@@ -215,6 +215,15 @@ class ConfigManager(object):
''' Load YAML Config Files in order, check merge flags, keep origin of settings'''
pass
+ def get_plugin_options(self, plugin_type, name, variables=None):
+
+ options = {}
+ defs = self.get_configuration_definitions(plugin_type, name)
+ for option in defs:
+ options[option] = self.get_config_value(option, plugin_type=plugin_type, plugin_name=name, variables=variables)
+
+ return options
+
def get_configuration_definitions(self, plugin_type=None, name=None):
''' just list the possible settings, either base or for specific plugins or plugin '''
@@ -224,7 +233,7 @@ class ConfigManager(object):
elif name is None:
ret = self._plugins.get(plugin_type, {})
else:
- ret = {name: self._plugins.get(plugin_type, {}).get(name, {})}
+ ret = self._plugins.get(plugin_type, {}).get(name, {})
return ret
@@ -287,7 +296,7 @@ class ConfigManager(object):
for ini_entry in defs[config]['ini']:
value = get_ini_config_value(self._parser, ini_entry)
origin = cfile
- if 'deprecated' in ini_entry:
+ if value is not None and 'deprecated' in ini_entry:
self.DEPRECATED.append(('[%s]%s' % (ini_entry['section'], ini_entry['key']), ini_entry['deprecated']))
except Exception as e:
sys.stderr.write("Error while loading ini config %s: %s" % (cfile, to_native(e)))