Clean up CONDITIONAL_BARE_VARS warning. Fixes #67735 (#67751)

pull/67756/head
Matt Martz 6 years ago committed by GitHub
parent 370f788731
commit 6e1a59174a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,3 @@
bugfixes:
- Update the warning message for ``CONDITIONAL_BARE_VARS`` to list the original conditional
not the value of the original conditional (https://github.com/ansible/ansible/issues/67735)

@ -133,8 +133,8 @@ class Conditional:
disable_lookups = hasattr(conditional, '__UNSAFE__')
conditional = templar.template(conditional, disable_lookups=disable_lookups)
if bare_vars_warning and not isinstance(conditional, bool):
display.deprecated('evaluating %s as a bare variable, this behaviour will go away and you might need to add |bool'
' to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle' % conditional, "2.12")
display.deprecated('evaluating %r as a bare variable, this behaviour will go away and you might need to add |bool'
' to the expression in the future. Also see CONDITIONAL_BARE_VARS configuration toggle' % original, "2.12")
if not isinstance(conditional, text_type) or conditional == "":
return conditional

Loading…
Cancel
Save