I just found that 3.1.0 handles differently the combination of
insert_lines and replace_patterns. Before 3.1.0, once insert_lines had
inserted a line, it would not be re-inserted after replace_patterns
has changed it.

In 3.1.0 however, it seems that insert_lines will be evaluated up to 3
times, even if the first 1 or 2 were successful in inserting a line.
The result is up to 3 identical lines now get inserted, because
replace_patterns changes the inserted line, which causes the next
evaluation of insert_lines to not see it as present.

I have attached a self-contained bundle to demonstrate the issue - it
will create a file /tmp/foo then copy it to /tmp/bar using a file
reconstruct process. It can be used to clearly show the difference in
behaviour between 3.0.5 and 3.1.0.

I guess my question is was this an expected outcome of 3.1.0? If not,
I will file a bug report. If it was - how should the promise be
written such that insert_lines only inserts a line once during
execution?

Attachment: atest.cf
Description: Binary data

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to