Project

General

Profile

Actions

Bug #8586

closed

Wrong definition of class condition if we use a variable with [ ] in it

Bug #8586: Wrong definition of class condition if we use a variable with [ ] in it

Added by Nicolas CHARLES over 9 years ago. Updated over 3 years ago.

Status:
Rejected
Priority:
N/A
Assignee:
-
Category:
Web - Technique editor
Target version:
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


Related issues 3 (0 open3 closed)

Related to Rudder - Bug #10304: Broken variable expression when using node properties in the technique editorReleasedBenoît PECCATTEActions
Related to Rudder - Bug #12087: command_execution_result does not report anythingReleasedBenoît PECCATTEActions
Has duplicate Rudder - Bug #11600: Result class containing {} are not properly canonizedReleasedBenoît PECCATTEActions

Updated by Benoît PECCATTE over 9 years ago Actions #2

  • 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 about 9 years ago Actions #3

  • Category set to Technique editor - API

Updated by Benoît PECCATTE over 8 years ago Actions #4

  • 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 Jonathan CLARKE over 8 years ago Actions #5

  • Assignee deleted (Vincent MEMBRÉ)

Updated by Nicolas CHARLES over 8 years ago Actions #6

  • Related to Bug #10304: Broken variable expression when using node properties in the technique editor added

Updated by Vincent MEMBRÉ about 8 years ago Actions #7

  • Target version changed from 0.x to 3.1.25
  • Priority changed from 31 to 43

Updated by Vincent MEMBRÉ almost 8 years ago Actions #8

  • Target version changed from 3.1.25 to 387

Updated by Vincent MEMBRÉ almost 8 years ago Actions #9

  • Target version changed from 387 to 4.1.10

Updated by Nicolas CHARLES almost 8 years ago Actions #10

  • Related to Bug #12087: command_execution_result does not report anything added

Updated by Benoît PECCATTE almost 8 years ago Actions #11

  • Status changed from New to Rejected

Fixed by  #11600

Updated by Benoît PECCATTE almost 8 years ago Actions #12

  • Has duplicate Bug #11600: Result class containing {} are not properly canonized added

Updated by Alexis Mousset over 3 years ago Actions #13

  • Project changed from 41 to Rudder
  • Category changed from Technique editor - API to Web - Technique editor
  • Priority changed from 43 to 0
Actions

Also available in: PDF Atom