-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Port #50627 to master #56770
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
Port #50627 to master #56770
Conversation
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
For making changes to files based on a key/value pair. This commit also includes addition of an integration test to test the new behaviour added.
It should probably have suggested salt.utils.files.fopen() since using salt.utils.fopen() breaks when running it through the intergration test. It did seem to work when running it as a normal state module though. This should fix the additional lint errors.
Something on the windows2016-py2 build is throwing in what seems like utf-16le encoding shenanigans in somewhere, but only for the line actually being replaced, not any of the ones already there. This obviously (and correctly I think) fails the test. PermitRootLogin becomes P\x00e\x00r\x00m\x00i\x00t\x00R\x00o\x00o\x00t\x00L\x00o\x00g\x00i\x00n\x00 Also trying to be more OS friendly by using their native line separators.
integration.states.test_file.FileTest.test_keyvalue was already testing the file.keyvalue function since it used file.keyvalue_list already. Now there is only one function; file.keyvalue which takes either 2 parameters (key, and value) or a dictionary key_values to handle multiple key values in a single file all at once.
Left over from when this function was still part of an execution module. It got converted when it made a lot more sense to have it in an actual state module
df2342c
to
4e45ed1
Compare
dwoz
approved these changes
Apr 22, 2020
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.
What does this PR do?
See title
What issues does this PR fix or reference?
#50627
Merge requirements satisfied?
Commits signed with GPG?
Yes