1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-02-04 07:51:50 +00:00

[PR #11107/e20e32bb backport][stable-12] Extend failure message for merge_variables type detection (#11166)

Extend failure message for merge_variables type detection (#11107)

merge_variables: extend type detection failure message

Update the error message for the merge_variables lookup plugin in case an unsupported type is passed.

(cherry picked from commit e20e32bb87)

Co-authored-by: Roy Lenferink <lenferinkroy@gmail.com>
This commit is contained in:
patchback[bot] 2025-11-17 06:47:04 +01:00 committed by GitHub
parent 1f9d6787fb
commit 5ae8d2ccec
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
minor_changes:
- merge_variables - extend type detection failure message to allow users for easier failure debugging (https://github.com/ansible-collections/community.general/pull/11107).

View file

@ -129,7 +129,7 @@ def _verify_and_get_type(variable):
elif isinstance(variable, dict): elif isinstance(variable, dict):
return "dict" return "dict"
else: else:
raise AnsibleError("Not supported type detected, variable must be a list or a dict") raise AnsibleError(f"Not supported type detected, variable must be a list or a dict: '{variable}'")
class LookupModule(LookupBase): class LookupModule(LookupBase):