Project

General

Profile

Actions

Bug #14371

closed

At least on windows, technique editor parameters can not handle "_" char

Bug #14371: At least on windows, technique editor parameters can not handle "_" char

Added by Félix DALLIDET about 7 years ago. Updated over 3 years ago.

Status:
Released
Priority:
N/A
Category:
Web - Technique editor
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
I hate Rudder for that
User visibility:
Getting started - demo | first install | Technique editor and level 1 Techniques
Effort required:
Very Small
Priority:
161
Name check:
Fix check:
Checked
Regression:
No

Description

When defining a ncf technique for dsc with a parameter named "kb_path", it creates a parameter named "KbPath" in the dsc technique, but the call to generic methods using the parameter use "${kb_path} instead of "${KbPath}".

WORKAROUND: As for now, please don't use "_" in parameter names in windows techniques created with the editor.


Related issues 2 (0 open2 closed)

Related to Rudder - Bug #17846: Directive parameters are not passed to DSC Agent command_execution when it contains an underscore _ResolvedActions
Related to Rudder - Bug #14372: Ncf techniques used in windows can not start with a numerical charReleasedVincent MEMBRÉActions

Updated by François ARMAND about 7 years ago Actions #1

  • Target version changed from 5.0.7 to 5.0.9

Updated by François ARMAND almost 7 years ago Actions #2

  • Severity set to Major - prevents use of part of Rudder | no simple workaround
  • User visibility set to Getting started - demo | first install | Technique editor and level 1 Techniques
  • Priority changed from 0 to 102

Updated by François ARMAND almost 7 years ago Actions #3

  • Assignee set to Vincent MEMBRÉ

We may have forgot an escape somewhere.

Updated by Vincent MEMBRÉ almost 7 years ago Actions #4

  • Target version changed from 5.0.9 to 5.0.10
  • Priority changed from 102 to 101

Updated by Vincent MEMBRÉ almost 7 years ago Actions #5

  • Target version changed from 5.0.10 to 5.0.11
  • Priority changed from 101 to 99

Updated by Vincent MEMBRÉ almost 7 years ago Actions #6

  • Target version changed from 5.0.11 to 5.0.12

Updated by Vincent MEMBRÉ over 6 years ago Actions #7

  • Target version changed from 5.0.12 to 5.0.13
  • Priority changed from 99 to 97

Updated by Vincent MEMBRÉ over 6 years ago Actions #8

  • Target version changed from 5.0.13 to 5.0.14
  • Priority changed from 97 to 94

Updated by François ARMAND over 6 years ago Actions #9

  • Effort required set to Small
  • Priority changed from 94 to 107

Updated by François ARMAND over 6 years ago Actions #10

  • Description updated (diff)

Updated by Vincent MEMBRÉ over 6 years ago Actions #11

  • Target version changed from 5.0.14 to 5.0.15
  • Priority changed from 107 to 106

Updated by Vincent MEMBRÉ over 6 years ago Actions #12

  • Target version changed from 5.0.15 to 5.0.16
  • Priority changed from 106 to 102

Updated by Alexis Mousset about 6 years ago Actions #13

  • Target version changed from 5.0.16 to 5.0.17
  • Priority changed from 102 to 98

Updated by Vincent MEMBRÉ almost 6 years ago Actions #14

  • Target version changed from 5.0.17 to 5.0.18

Updated by Félix DALLIDET over 5 years ago Actions #15

  • Related to Bug #17846: Directive parameters are not passed to DSC Agent command_execution when it contains an underscore _ added

Updated by François ARMAND over 5 years ago Actions #16

  • Assignee changed from Vincent MEMBRÉ to Félix DALLIDET

1/ we need to find back what are the exact rules for authorized chars in what kind of names

=> either find original commit or relevant documentation/test
(MS: doc: https://docs.microsoft.com/en-us/powershell/module/microsoft.powershell.core/about/about_variables?view=powershell-7)

2/ adapt the rules to keep working cases working, and handle the news ones.

Step 1: Felix, can you document what cases of "_" are foriden

Updated by Nicolas CHARLES over 5 years ago Actions #17

  • Related to Bug #14372: Ncf techniques used in windows can not start with a numerical char added

Updated by Vincent MEMBRÉ over 5 years ago Actions #19

  • Target version changed from 5.0.18 to 5.0.19

Updated by Vincent MEMBRÉ over 5 years ago Actions #20

  • Target version changed from 5.0.19 to 5.0.20

Updated by Vincent MEMBRÉ over 5 years ago Actions #21

  • Target version changed from 5.0.20 to 797

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

  • Target version changed from 797 to 6.1.14

Updated by Vincent MEMBRÉ over 4 years ago Actions #23

  • Target version changed from 6.1.14 to 6.1.15

Updated by Vincent MEMBRÉ over 4 years ago Actions #24

  • Target version changed from 6.1.15 to 6.1.16

Updated by Vincent MEMBRÉ over 4 years ago Actions #25

  • Target version changed from 6.1.16 to 6.1.17

Updated by Vincent MEMBRÉ over 4 years ago Actions #26

  • Target version changed from 6.1.17 to 6.1.18

Updated by Vincent MEMBRÉ about 4 years ago Actions #27

  • Target version changed from 6.1.18 to 6.1.19

Updated by Vincent MEMBRÉ almost 4 years ago Actions #28

  • Target version changed from 6.1.19 to 6.1.20
  • Priority changed from 98 to 100

Updated by Vincent MEMBRÉ almost 4 years ago Actions #29

  • Target version changed from 6.1.20 to 6.1.21
  • Priority changed from 100 to 101

Updated by Vincent MEMBRÉ over 3 years ago Actions #31

  • Target version changed from 6.1.21 to old 6.1 issues to relocate
  • Priority changed from 101 to 74

Updated by Félix DALLIDET over 3 years ago Actions #32

  • Effort required changed from Small to Very Small
  • Priority changed from 74 to 0
  • Regression set to No

The issue here is not powershell based. It comes from the policy generation process:

  • Given a "server_stuff" parameter, I end up with the following technique:
    function Badaboum {
      [CmdletBinding()]
      param (
          [parameter(Mandatory=$true)]
          [string]$reportId,
          [parameter(Mandatory=$true)]
          [string]$techniqueName,
          [parameter(Mandatory=$true)]
          [string]$ServerStuff,
          [Rudder.PolicyMode]$policyMode
      )
      BeginTechniqueCall -Name $techniqueName
      $reportIdBase = $reportId.Substring(0,$reportId.Length-1)
      $localContext = [Rudder.Context]::new($techniqueName)
      $localContext.Merge($system_classes)
      $resources_dir = $PSScriptRoot + "\resources" 
    
      $reportId=$reportIdBase+"58c380a3-3e54-4b39-bcf5-783340fa1793" 
      $componentKey = "Write-Host `"${server_stuff}`"" 
      $reportParams = @{
        ClassPrefix = ([Rudder.Condition]::canonify(("command_execution_" + $componentKey)))
        ComponentKey = $componentKey
        ComponentName = "Command execution" 
        PolicyMode = $policyMode
        ReportId = $reportId
        DisableReporting = $false
        TechniqueName = $techniqueName
      }
      $call = Command-Execution -Command "Write-Host `"${server_stuff}`"" -PolicyMode $policyMode
      $methodContext = Compute-Method-Call @reportParams -MethodCall $call
      $localContext.merge($methodContext)
      EndTechniqueCall -Name $techniqueName
    }
    

Which is false as the parameter of the technique is chnaged to "ServerStuff" instead of "server_stuff". It also needs to be changed in the directive.ps1 generated file.

Updated by Vincent MEMBRÉ over 3 years ago Actions #33

  • Target version changed from old 6.1 issues to relocate to 7.1.8

Updated by Vincent MEMBRÉ over 3 years ago Actions #34

  • UX impact set to I hate Rudder for that
  • Priority changed from 0 to 160

Updated by Vincent MEMBRÉ over 3 years ago Actions #35

  • Status changed from New to In progress
  • Assignee changed from Félix DALLIDET to Vincent MEMBRÉ

Updated by Vincent MEMBRÉ over 3 years ago Actions #36

  • Status changed from In progress to Pending technical review
  • Assignee changed from Vincent MEMBRÉ to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/4563

Updated by Vincent MEMBRÉ over 3 years ago Actions #37

  • Assignee changed from François ARMAND to Félix DALLIDET

Updated by Vincent MEMBRÉ over 3 years ago Actions #38

  • Status changed from Pending technical review to Pending release
  • Priority changed from 160 to 161

Updated by François ARMAND over 3 years ago Actions #39

  • Fix check set to Checked

Updated by Vincent MEMBRÉ over 3 years ago Actions #40

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 7.1.8 and 7.2.2 which were released today.

Actions

Also available in: PDF Atom