Project

General

Profile

Bug #11613

generic_variable_definition inserts spaces in multi lined values

Added by Janos Mattyasovszky about 2 months ago. Updated about 1 month ago.

Status:
Released
Priority:
N/A
Category:
Techniques
Target version:
Target version (plugin):
Severity:
Major - prevents use of part of Rudder | no simple workaround
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Priority:
52

Description

If you have a generic_variable_definition value that consists of multiple lines, due to how the .st file is built up, it inserts spaces as of the second line, indenting the content.

    &GENERIC_VARIABLE_NAME, GENERIC_VARIABLE_CONTENT:{name, content |"&name&" string => "&content&",

https://github.com/Normation/rudder-techniques/blob/91dc9d9e48d300afd76edcf37a961fa7069a3d5a/techniques/systemSettings/misc/genericVariableDefinition/2.0/genericVariableDefinition.st#L24

Resulting generated code example:

    "var_authorized_key_final" string => "${generic_variable_definition.auth_key_1}
    ${generic_variable_definition.auth_key_2}",

That results in a content, when written to a file:

ssh-rsa AAAAB3NzaC1yc2EAAA
    ssh-rsa AAAAB3NzaC1yc2


Subtasks

Bug #11629: Same as parent ticket for technique "Variables (any)"ReleasedAlexis MOUSSET

Associated revisions

Revision 8c5ef989
Added by Nicolas CHARLES about 2 months ago

Fixes #11613: generic_variable_definition inserts spaces in multi lined values

History

#1 Updated by Nicolas CHARLES about 2 months ago

Hi Janos
How can you multiline with this technique ?

#2 Updated by Janos Mattyasovszky about 2 months ago

  • Description updated (diff)

#3 Updated by Janos Mattyasovszky about 2 months ago

  • Description updated (diff)

#4 Updated by Florian Heigl about 2 months ago

it is my understanding that this use was never indented.
now the question is if it would be possible to fix it to actually work, since it seems to be pretty close to working.

#5 Updated by Janos Matya about 2 months ago

You just have to remove some spaces in front of the variable substitution of string template, the diff is basically about 6x [space]...

#6 Updated by Nicolas CHARLES about 2 months ago

  • Assignee set to Nicolas CHARLES
  • Target version set to 3.1.24

#7 Updated by Nicolas CHARLES about 2 months ago

  • Status changed from New to In progress

#8 Updated by Nicolas CHARLES about 2 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to Alexis MOUSSET
  • Pull Request set to https://github.com/Normation/rudder-techniques/pull/1212

#9 Updated by Nicolas CHARLES about 2 months ago

  • Status changed from Pending technical review to Pending release

#10 Updated by Vincent MEMBRÉ about 1 month ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.24, 4.1.8 and 4.2.1 which were released today.

Also available in: Atom PDF