From 447d1cffb0cb6b0f0147727f4354fac003724a9f Mon Sep 17 00:00:00 2001 From: David Moreau-Simard Date: Mon, 2 Oct 2017 12:08:54 -0400 Subject: [PATCH] Fix backwards compatibility of constants.get_config get_config would use ConfigManager.get_ini_value which does not exist. What we are meant to use is ansible.config.manager.get_ini_config_value and this method does not expect a list, only a dictionary with a section and a key. (cherry picked from commit 9b693235f0655293fd3fa77aed4a8ee1841517b1) --- CHANGELOG.md | 1 + lib/ansible/constants.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a3b1fc9a3d..b7775b75d7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,7 @@ Ansible Changes By Release * Fix aws_s3 module handling `encrypt` option (https://github.com/ansible/ansible/pull/31203) * Fix for win_msg to document and show error when message is greater than 255 characters * Fix for win_dotnet_ngen to work after recent regression +* fixed backwards compat method for config diff --git a/lib/ansible/constants.py b/lib/ansible/constants.py index 566b1d6e774..6541a6eb082 100644 --- a/lib/ansible/constants.py +++ b/lib/ansible/constants.py @@ -15,7 +15,7 @@ from string import ascii_letters, digits from ansible.module_utils._text import to_text from ansible.module_utils.parsing.convert_bool import boolean, BOOLEANS_TRUE from ansible.module_utils.six import string_types -from ansible.config.manager import ConfigManager, ensure_type +from ansible.config.manager import ConfigManager, ensure_type, get_ini_config_value def _deprecated(msg): @@ -43,7 +43,7 @@ def get_config(parser, section, key, env_var, default_value, value_type=None, ex value = os.environ.get(env_var, None) if value is None: try: - value = config.get_ini_config(parser, [{'key': key, 'section': section}]) + value = get_ini_config_value(parser, {'key': key, 'section': section}) except: pass if value is None: