Project

General

Profile

Actions

Bug #18009

open

File in INI section method does not work as intended

Added by Félix DALLIDET over 4 years ago. Updated 5 months ago.

Status:
Pending technical review
Priority:
N/A
Category:
Generic methods
Target version:
Severity:
Major - prevents use of part of Rudder | no simple workaround
UX impact:
User visibility:
Operational - other Techniques | Rudder settings | Plugins
Effort required:
Small
Priority:
0
Name check:
To do
Fix check:
To do
Regression:
No

Description

There is a very misleading bug in this GM.

You can write whatever you want in a section of an inifile, so I used to write the header section of the next section using this method,
even if it is supposed to create a given section if undefined, just to be sure of the section order.

The issue is that the new section header will be written without newline after it. But the section matcher seems to requires a newline after a section name to match it...
So I end up with my technique which:
-Creates a section header under an already existing section, like

[My_section]
some lines
[My_second_section]

-But when it tries to write a line under the second section, it does not detect it since there is no newline after it
-And tries to create the second section, which is detected and so, not created... and so the method does not write the lines under it

The worst part is that it reports a success everywhere.


Related issues 1 (0 open1 closed)

Related to Rudder - Bug #8638: file_ensure_lines_present_in_ini_section.cf test fails with CFEngine 3.9ReleasedNicolas CHARLESActions
Actions

Also available in: Atom PDF