Skip to content

(MODULES-5651) Do not append infinitely #825

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

hunner
Copy link
Contributor

@hunner hunner commented Oct 12, 2017

https://tickets.puppetlabs.com/browse/MODULES-5003 gave rise to #788 and #794 which caused different behavior based on whether the line value was matched by the match regex or not.

The change in behavior was both breaking and broken, though that was hard to tell because the behavior was ill-described in general.

[bugfix] This commit resolves the breaking behavior by reverting the behavior of "replacing matches when a line matching line exists even when multiple is set to true".

[feature] This commit adds a new parameter to make file_line replace all matches universally with the line value, even when the line exists elsewhere in the file. This feature only affects modifying multiple lines in a file when the line value already exists.

[bugfix] This commit more strictly defines the various interactions of ensure, match, append_on_no_match, replace, multiple, and replace_all_matches_not_matching_line. It also more clearly documents and tests these interactions.

@hunner hunner changed the title {WIP} (MODULES-5651) Do not append infinitely (MODULES-5651) Do not append infinitely Oct 13, 2017
https://tickets.puppetlabs.com/browse/MODULES-5003 gave rise to
puppetlabs#788 and
puppetlabs#794 which caused
different behavior based on whether the line value was matched by the
match regex or not.

The change in behavior was both breaking and broken, though that was
hard to tell because the behavior was ill-described in general.

[bugfix] This commit resolves the breaking behavior by reverting the
behavior of "replacing matches when a line matching `line` exists even
when `multiple` is set to `true`".

[feature] This commit adds a new parameter to make file_line replace all
matches universally with the `line` value, even when the line exists
elsewhere in the file. This feature only affects modifying multiple
lines in a file when the `line` value already exists.

[bugfix] This commit more strictly defines the various interactions of
`ensure`, `match`, `append_on_no_match`, `replace`, `multiple`, and
`replace_all_matches_not_matching_line`. It also more clearly documents
and tests these interactions.
end
end
context "when match+replace+append_on_no_match" do
end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops?

@HAIL9000 HAIL9000 merged commit 8376c9b into puppetlabs:master Oct 17, 2017
@hunner hunner deleted the fix_append branch November 30, 2017 00:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants