Project

General

Profile

Actions

Bug #24537

closed

Regex in file replace line must not match the string used as replacement

Added by Elaad FURREEDAN 9 months ago. Updated 8 months ago.

Status:
Released
Priority:
N/A
Category:
Generic methods
Target version:
Severity:
UX impact:
User visibility:
Effort required:
Priority:
0
Name check:
To do
Fix check:
Checked
Regression:
No

Description

If the regex match the string used as replacement, the method will fail to replace the line

2024-03-18T23:58:06+00:00    error: Promised replacement 'DNS1=1.1.1.1' on line 'DNS1=123.4.23.4' for pattern 'DNS1(.*)' is not convergent while editing '/tmp/ifcfg-eth0' (regular expression matches the replacement string)
2024-03-18T23:58:06+00:00    error: Promise belongs to bundle 'regex_replace' in file '/var/rudder/ncf/common/20_cfe_basics/cfengine/files.cf' near line 328
2024-03-18T23:58:06+00:00    error: Comment is 'Search and replace string'
2024-03-18T23:58:06+00:00    error: Errors encountered when actuating replace_patterns promise 'DNS1(.*)'

The documentation of the method does not mention this behavior, and it is not clear why the method is not working.

Actions #2

Updated by Elaad FURREEDAN 9 months ago

  • Status changed from New to In progress
Actions #3

Updated by Elaad FURREEDAN 9 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Elaad FURREEDAN to Nicolas CHARLES
  • Pull Request set to https://github.com/Normation/ncf/pull/1420
Actions #4

Updated by Anonymous 9 months ago

  • Status changed from Pending technical review to Pending release
Actions #5

Updated by Alexis Mousset 8 months ago

  • Fix check changed from To do to Checked
Actions #6

Updated by Vincent MEMBRÉ 8 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 7.3.14, 8.0.8 and 8.1.1 which were released today.

Actions

Also available in: Atom PDF