Actions
Question #11261
closedDouble-ampersand is not an "empty template variable"
Regression:
Description
While writing technique template (*.st), currently it is impossible to use "&&", e.g. in implementation of shell commands.
Writing something like
commands: plugin_exist:: "${rabbitmqpl} list -m -e ^${pluginName}$ | /bin/grep -q ${pluginName} && /bin/echo '+Enabled'"
leads to error in generating promises from such directive.
Looks like Rudder assumes that two ampersands are always quoting template varialbes. But "&&" is just "&&", not an empty template entry.
(And single ampersand may although be needed in shell scripting.)
On the opposite, the following code works ok:
commands: plugin_exist:: "${rabbitmqpl} list -m -e ^${pluginName}$ | /bin/grep -q ${pluginName} || /bin/echo '+notEnabled'"
(?) M.b. there is the way to correctly escape "&" to bypass it inside promise?
Updated by François ARMAND almost 8 years ago
- Severity set to Minor - inconvenience | misleading | easy workaround
- User visibility set to Operational - other Techniques | Technique editor | Rudder settings
- Priority changed from 0 to 32
Updated by Vincent MEMBRÉ over 7 years ago
- Target version changed from 4.1.9 to 4.1.10
- Priority changed from 32 to 31
Updated by Benoît PECCATTE over 7 years ago
- Tracker changed from Bug to Question
- Status changed from New to Resolved
Actions