Actions
Bug #8586
closedWrong definition of class condition if we use a variable with [ ] in it
Pull Request:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Priority:
0
Name check:
Fix check:
Regression:
Description
If we set a command execution with command
echo ${corp.admin_infra[username]} > /tmp/admin_infra
theresult classes displayed are:
command_execution_echo_${corp.admin_infra[username_}____tmp_admin_infra_kept command_execution_echo_${corp.admin_infra[username_}____tmp_admin_infra_repaired command_execution_echo_${corp.admin_infra[username_}____tmp_admin_infra_error
Files
Updated by Nicolas CHARLES over 8 years ago
Updated by Benoît PECCATTE over 8 years ago
- Assignee changed from Benoît PECCATTE to Vincent MEMBRÉ
The code to do it is in builder/js/ncf.js in function getClassKind
param = param.replace(/\\'/g, "'").replace(/\\"/g, '"').replace(/[^\${}\w](?![^{}]+})|\$(?!{)/g,"_");
The regex is a negative one that trie to replace any invalid character that is not part of a variable.
I suggest to replace this with a positive regex that replaces everything valid (which can be longer that a char) by itself and everything else by a '_'.
The replace becomes (perl syntax) :
( variable | valid_char or nothing ) then invalid_char -> 'valid_part' then '_'
s/(\$\{[\w\[\]\${}]+\}|\w*)[^\w]/$1_/g
Updated by Alexis Mousset over 8 years ago
- Category set to Technique editor - API
Updated by Benoît PECCATTE over 7 years ago
- Severity set to Major - prevents use of part of Rudder | no simple workaround
- User visibility set to Operational - other Techniques | Technique editor | Rudder settings
- Priority set to 31
Updated by Nicolas CHARLES over 7 years ago
- Related to Bug #10304: Broken variable expression when using node properties in the technique editor added
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 0.x to 3.1.25
- Priority changed from 31 to 43
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 3.1.25 to 387
Updated by Vincent MEMBRÉ about 7 years ago
- Target version changed from 387 to 4.1.10
Updated by Nicolas CHARLES almost 7 years ago
- Related to Bug #12087: command_execution_result does not report anything added
Updated by Benoît PECCATTE almost 7 years ago
- Has duplicate Bug #11600: Result class containing {} are not properly canonized added
Updated by Alexis Mousset over 2 years ago
- Project changed from 41 to Rudder
- Category changed from Technique editor - API to Web - Technique editor
- Priority changed from 43 to 0
Actions