Project

General

Profile

Actions

Bug #23389

open

Wrong class_prefix used when parameters contains ${something} expression

Added by Alexis Mousset about 1 year ago. Updated 5 months ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Generic methods
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

For example, if a file_content is called with a content containing ${releasever} (for a rpm repo URL), the class prefix won't be correctly defined.

In file_content.cf:

vars:
   # this variable keeps previous value is report_param constains an expression looking like an non-expanded variable
   "full_class_prefix" string => canonify("file_lines_present_${report_param}");

reports:
  pass2.!pass3::
    "full_class_prefix = ${full_class_prefix} (editing ${path})";

This will lead to re-using the full class prefix of the previous call to method and lead to incorrect reporting.

E| compliant     technique                 File content              /tmp/plop          Insert content into /tmp/plop was correct
2023-09-05T21:37:51+00:00 R: full_class_prefix = file_lines_present__tmp_plop_plop_true (editing /tmp/plop)
E| compliant     technique                 File content              /tmp/test          Insert content into /tmp/test was correct
2023-09-05T21:37:51+00:00 R: full_class_prefix = file_lines_present__tmp_plop_plop_true (editing /tmp/test)

Files

clipboard-202309052335-adxxd.png (20.3 KB) clipboard-202309052335-adxxd.png Alexis Mousset, 2023-09-05 23:35
Actions

Also available in: Atom PDF