-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to escape ${var} in parameter value #55
Comments
I have not catered for this, I don't think. But it shouldn't be hard to add an escape handler. |
Hi Martin, Thx for the reply. I’m not very good in python – so I want to ask you to invest some more of your time in your splendid product. Do you think it’s possible for you to fix that? Best regards Frank Stuppy Vorsitzender des Aufsichtsrats: Christian Diedrich Von: martin f. krafft [mailto:[email protected]] I have not catered for this, I don't think. But it shouldn't be hard to add an escape handler. — |
Not anytime soon. I am totally busy elsewhere after I've funding for reclass has been removed. |
I can look into implementing this in my fork. I'll open a PR back to upstream if I produce anything worth looking at. |
I agree with this problem, but how would you solve it? I suppose you could insert an escape like Maybe it could be define by the following rule: is possible to escape a variable substitution if it is placed a backslash before the dollar, but is you'd need to post a backslash before a variable substitution you should place again a backslash before it. |
Haven't had time to circle back to this issue yet, and a couple other features have come up which we're looking at with priority. PRs are welcome in the meantime. |
We are doing this way: parameters:
dollar: '$' # escaping
url: http://my.domain.com/tst/do?nr=${dollar}{nr} |
Fix: use returned parameter from _render_simple_dict/list in exports class
I've a class test.yml with the following def:
parameters:
url: http://my.domain.com/tst/do?nr=${nr}
${nr} is not a reclass variable just a normal string which should be passed to app...
How to escape ${nr} in parameter string? (e.g. ${nr} or similar)
The error I got:
reclass-salt --pillar node1
Traceback (most recent call last):
File "/usr/bin/reclass-salt", line 9, in
load_entry_point('reclass==1.4.1', 'console_scripts', 'reclass-salt')()
File "build/bdist.linux-x86_64/egg/reclass/adapters/salt.py", line 105, in cli
File "build/bdist.linux-x86_64/egg/reclass/adapters/salt.py", line 38, in ext_pillar
File "build/bdist.linux-x86_64/egg/reclass/core.py", line 136, in nodeinfo
File "build/bdist.linux-x86_64/egg/reclass/core.py", line 122, in _nodeinfo
File "build/bdist.linux-x86_64/egg/reclass/datatypes/entity.py", line 65, in interpolate
File "build/bdist.linux-x86_64/egg/reclass/datatypes/parameters.py", line 180, in interpolate
File "build/bdist.linux-x86_64/egg/reclass/datatypes/parameters.py", line 219, in _interpolate_inner
AttributeError: 'UndefinedVariableError' object has no attribute 'var'
The text was updated successfully, but these errors were encountered: