reclass
reclass copied to clipboard
How to escape ${var} in parameter value
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
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 Franky
Frank Stuppy ITERGO Informationstechnologie GmbH ERV Basisinfrastruktur (PEBE M) Thomas-Dehler-Straße 2 81737 München Tel. 089/4166-1250 Fax 089/4166-2250 [email protected]:[email protected]
Vorsitzender des Aufsichtsrats: Christian Diedrich Geschäftsführung: Tomasz Smaczny (Vorsitzender), Lothar Engelke, Joachim Fensch, Bernd Jung, Dr. Michael Regauer. Sitz: Düsseldorf, Handelsregister: Amtsgericht Düsseldorf, HRB 37996
Von: martin f. krafft [mailto:[email protected]] Gesendet: Dienstag, 2. August 2016 20:40 An: madduck/reclass [email protected] Cc: Stuppy Frank [email protected]; Author [email protected] Betreff: Re: [madduck/reclass] How to escape ${var} in parameter value (#55)
I have not catered for this, I don't think. But it shouldn't be hard to add an escape handler.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/madduck/reclass/issues/55#issuecomment-237000780, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AL7qhI9Hy_OHgVBigZrSvWc6ZcB7EjbYks5qb48AgaJpZM4JaV78.
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 \${var}
, but what should you type if you'd need to write exactly \
followed instead by a variable substitution?
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}