Skip to content

Commit 04f2abb

Browse files
committed
merge_variables: extend type detection failure message
Update the error message for the merge_variables lookup plugin in case an unsupported type is passed.
1 parent 6c1676f commit 04f2abb

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- merge_variables - extend type detection failure message to allow users for easier failure debugging (https://github.com/ansible-collections/community.general/pull/11107).

plugins/lookup/merge_variables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def _verify_and_get_type(variable):
129129
elif isinstance(variable, dict):
130130
return "dict"
131131
else:
132-
raise AnsibleError("Not supported type detected, variable must be a list or a dict")
132+
raise AnsibleError(f"Not supported type detected, variable must be a list or a dict: '{variable}'")
133133

134134

135135
class LookupModule(LookupBase):

0 commit comments

Comments
 (0)