mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-03 23:20:19 -07:00
Fixup legacy var detector.
This commit is contained in:
parent
709ffda3d1
commit
add45d2ca9
2 changed files with 4 additions and 2 deletions
|
@ -262,6 +262,8 @@ def legacy_varReplace(basedir, raw, vars, lookup_fatal=True, depth=0, expand_lis
|
||||||
''' Perform variable replacement of $variables in string raw using vars dictionary '''
|
''' Perform variable replacement of $variables in string raw using vars dictionary '''
|
||||||
# this code originally from yum
|
# this code originally from yum
|
||||||
|
|
||||||
|
orig = raw
|
||||||
|
|
||||||
if not isinstance(raw, unicode):
|
if not isinstance(raw, unicode):
|
||||||
raw = raw.decode("utf-8")
|
raw = raw.decode("utf-8")
|
||||||
|
|
||||||
|
@ -294,7 +296,7 @@ def legacy_varReplace(basedir, raw, vars, lookup_fatal=True, depth=0, expand_lis
|
||||||
|
|
||||||
result = ''.join(done)
|
result = ''.join(done)
|
||||||
|
|
||||||
if result != raw:
|
if result != orig:
|
||||||
from ansible import utils
|
from ansible import utils
|
||||||
utils.deprecated("Legacy variable subsitution, such as using ${foo} or $foo instead of {{ foo }} is currently valid but will be phased out and has been out of favor since version 1.2. This is the last of legacy features on our deprecation list. You may continue to use this if you have specific needs for now","1.6")
|
utils.deprecated("Legacy variable subsitution, such as using ${foo} or $foo instead of {{ foo }} is currently valid but will be phased out and has been out of favor since version 1.2. This is the last of legacy features on our deprecation list. You may continue to use this if you have specific needs for now","1.6")
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
action: command true
|
action: command true
|
||||||
|
|
||||||
- name: test basic shell, plus two ways to dereference a variable
|
- name: test basic shell, plus two ways to dereference a variable
|
||||||
action: shell echo $HOME {{port}}
|
action: shell echo {{HOME}} {{port}}
|
||||||
|
|
||||||
- name: test vars_files imports
|
- name: test vars_files imports
|
||||||
action: shell echo {{duck}} {{cow}} {{testing}}
|
action: shell echo {{duck}} {{cow}} {{testing}}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue