mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-10 02:41:30 +00:00
Revert "Make listify respect the global setting for undefined variables."
This 'mostly' reverts commit 2769098fe7.
Conflicts:
lib/ansible/utils/__init__.py
test/units/TestUtils.py
This commit is contained in:
@@ -566,17 +566,9 @@ class TestUtils(unittest.TestCase):
|
||||
|
||||
def test_listify_lookup_plugin_terms(self):
|
||||
basedir = os.path.dirname(__file__)
|
||||
|
||||
# Straight lookups
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=[])), [])
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['one', 'two'])), ['one', 'two'])
|
||||
|
||||
# Variable interpolation
|
||||
self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['{{ foo }}', '{{ bar }}'], foo="hello", bar="world")),
|
||||
['hello', 'world'])
|
||||
with self.assertRaises(ansible.errors.AnsibleError) as ex:
|
||||
ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['{{ foo }}', '{{ bar_typo }}'], foo="hello", bar="world"))
|
||||
self.assertTrue("undefined variable in items: 'bar_typo'" in ex.exception.msg)
|
||||
#self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=[])), [])
|
||||
#self.assertEqual(ansible.utils.listify_lookup_plugin_terms('things', basedir, dict(things=['one', 'two'])), ['one', 'two'])
|
||||
|
||||
def test_deprecated(self):
|
||||
sys_stderr = sys.stderr
|
||||
|
||||
Reference in New Issue
Block a user