Merge pull request #13455 from Yannig/devel_fix_debug_var_when_content_same_as_name
Fix issue when var name is the same as content.
This commit is contained in:
commit
2884ff3932
1 changed files with 5 additions and 1 deletions
|
@ -45,8 +45,12 @@ class ActionModule(ActionBase):
|
|||
# If var is a list or dict, use the type as key to display
|
||||
result[to_unicode(type(self._task.args['var']))] = results
|
||||
else:
|
||||
# If var name is same as result, try to template it
|
||||
if results == self._task.args['var']:
|
||||
results = "VARIABLE IS NOT DEFINED!"
|
||||
try:
|
||||
results = self._templar.template("{{" + results + "}}", convert_bare=True, fail_on_undefined=True)
|
||||
except:
|
||||
results = "VARIABLE IS NOT DEFINED!"
|
||||
result[self._task.args['var']] = results
|
||||
else:
|
||||
result['msg'] = 'here we are'
|
||||
|
|
Loading…
Reference in a new issue