(PUP-2571) add 'before' functionality to file_line#256
Merged
apenney merged 1 commit intopuppetlabs:masterfrom May 15, 2014
Merged
(PUP-2571) add 'before' functionality to file_line#256apenney merged 1 commit intopuppetlabs:masterfrom
apenney merged 1 commit intopuppetlabs:masterfrom
Conversation
file_line supports adding lines after a match, but there are use cases when having "before" would be useful. For example, in Debian-based OS's, the last line of /etc/rc.local is "exit 0" it's an incredible pain to deal with that scenario today. This commit adds a 'before' parameter to the file_line type, and implements it for the ruby provider.
apenney
pushed a commit
that referenced
this pull request
May 15, 2014
(PUP-2571) add 'before' functionality to file_line
apenney
pushed a commit
that referenced
this pull request
May 15, 2014
Revert "Merge pull request #256 from stbenjam/2571-before"
|
#257 <-- I just had to revert this, it causes puppetlabs-apache tests to fail with:
|
|
We saw this on Puppet 2.7, so its probably just an issue there. |
Contributor
Author
|
@apenney Oops, sorry about that! I didn't even realize this, but "before" is a bad name because of resource ordering. That's what's breaking puppetlabs-apache (and probably a bunch of other things). Renaming this to 'precede' fixes the puppetlabs-apache tests. I'm not sure I like "precede" though :-( I'd rather the structure be something like this with positon being before, after, or overwrite. That's too big of a change I guess. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
file_line supports adding lines after a match, but there are use cases when
having "before" would be useful. For example, in Debian-based OS's, the last
line of /etc/rc.local is "exit 0" it's an incredible pain to deal with
that scenario today.
This commit adds a 'before' parameter to the file_line type, and implements
it for the ruby provider.