Project

General

Profile

Actions

Bug #14371

closed

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

Added by Félix DALLIDET over 5 years ago. Updated almost 2 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
Actions #1

Updated by François ARMAND over 5 years ago

  • Target version changed from 5.0.7 to 5.0.9
Actions #2

Updated by François ARMAND over 5 years ago

  • 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
Actions #3

Updated by François ARMAND over 5 years ago

  • Assignee set to Vincent MEMBRÉ

We may have forgot an escape somewhere.

Actions #4

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.9 to 5.0.10
  • Priority changed from 102 to 101
Actions #5

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.10 to 5.0.11
  • Priority changed from 101 to 99
Actions #6

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.11 to 5.0.12
Actions #7

Updated by Vincent MEMBRÉ over 5 years ago

  • Target version changed from 5.0.12 to 5.0.13
  • Priority changed from 99 to 97
Actions #8

Updated by Vincent MEMBRÉ about 5 years ago

  • Target version changed from 5.0.13 to 5.0.14
  • Priority changed from 97 to 94
Actions #9

Updated by François ARMAND about 5 years ago

  • Effort required set to Small
  • Priority changed from 94 to 107
Actions #10

Updated by François ARMAND about 5 years ago

  • Description updated (diff)
Actions #11

Updated by Vincent MEMBRÉ about 5 years ago

  • Target version changed from 5.0.14 to 5.0.15
  • Priority changed from 107 to 106
Actions #12

Updated by Vincent MEMBRÉ almost 5 years ago

  • Target version changed from 5.0.15 to 5.0.16
  • Priority changed from 106 to 102
Actions #13

Updated by Alexis Mousset almost 5 years ago

  • Target version changed from 5.0.16 to 5.0.17
  • Priority changed from 102 to 98
Actions #14

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.17 to 5.0.18
Actions #15

Updated by Félix DALLIDET over 4 years ago

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

Updated by François ARMAND over 4 years ago

  • 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

Actions #17

Updated by Nicolas CHARLES over 4 years ago

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

Updated by Vincent MEMBRÉ over 4 years ago

  • Target version changed from 5.0.18 to 5.0.19
Actions #20

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 5.0.19 to 5.0.20
Actions #21

Updated by Vincent MEMBRÉ about 4 years ago

  • Target version changed from 5.0.20 to 797
Actions #22

Updated by Benoît PECCATTE over 3 years ago

  • Target version changed from 797 to 6.1.14
Actions #23

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 6.1.14 to 6.1.15
Actions #24

Updated by Vincent MEMBRÉ over 3 years ago

  • Target version changed from 6.1.15 to 6.1.16
Actions #25

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 6.1.16 to 6.1.17
Actions #26

Updated by Vincent MEMBRÉ about 3 years ago

  • Target version changed from 6.1.17 to 6.1.18
Actions #27

Updated by Vincent MEMBRÉ almost 3 years ago

  • Target version changed from 6.1.18 to 6.1.19
Actions #28

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.19 to 6.1.20
  • Priority changed from 98 to 100
Actions #29

Updated by Vincent MEMBRÉ over 2 years ago

  • Target version changed from 6.1.20 to 6.1.21
  • Priority changed from 100 to 101
Actions #31

Updated by Vincent MEMBRÉ over 2 years ago

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

Updated by Félix DALLIDET about 2 years ago

  • 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.

Actions #33

Updated by Vincent MEMBRÉ about 2 years ago

  • Target version changed from old 6.1 issues to relocate to 7.1.8
Actions #34

Updated by Vincent MEMBRÉ about 2 years ago

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

Updated by Vincent MEMBRÉ about 2 years ago

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

Updated by Vincent MEMBRÉ about 2 years ago

  • 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
Actions #37

Updated by Vincent MEMBRÉ about 2 years ago

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

Updated by Vincent MEMBRÉ almost 2 years ago

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

Updated by François ARMAND almost 2 years ago

  • Fix check set to Checked
Actions #40

Updated by Vincent MEMBRÉ almost 2 years ago

  • 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: Atom PDF