Project

General

Custom queries

Profile

Actions

Question #11261

closed

Double-ampersand is not an "empty template variable"

Added by Dmitry Svyatogorov almost 8 years ago. Updated over 7 years ago.

Status:
Resolved
Priority:
N/A
Assignee:
-
Category:
Techniques
Target version:
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?

#3

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
#4

Updated by Vincent MEMBRÉ almost 8 years ago

  • Target version changed from 4.1.7 to 4.1.8
#5

Updated by Vincent MEMBRÉ over 7 years ago

  • Target version changed from 4.1.8 to 4.1.9
#7

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
#9

Updated by Benoît PECCATTE over 7 years ago

  • Tracker changed from Bug to Question
  • Status changed from New to Resolved
Actions

Also available in: Atom PDF