-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Optimize file_tree ext_pillar and update file.managed to allow for binary contents #30268
Conversation
@terminalmage Could you please rebase and fix some lint? Thanks. |
6bc0673
to
ce3935f
Compare
@cachedout Still a lot of test failures, are these familiar? They don't seem related, but I'm looking deeper into it now. |
Replace occurrences of a pattern in a file | ||
Replace occurrences of a pattern in a file. If ``show_changes`` is | ||
``True``, then a diff of what changed will be returned, otherwise a | ||
``True`` will be returnd when changes are made are made, and ``False`` when |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are made are made
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
This also changes a few exceptions to match common usage (passive voice instead of imperative).
This modifies this ext_pillar to read in the file file_buffer_size bytes at a time. It also removes needlessly duplicated code for dictionary merging with salt.utils.dictupdate.merge(). Finally, the 'raw_data' argument is poorly-named and does not describe very well what it actually does, so I have renamed this option to 'keep_newline'.
This allows for binary contents to be used in file.managed when either contents, contents_pillar, or contents_grains is used. Prior to this commit, these options treated all of these options as only having string data. Additionally, documentation for this and a couple other states has been improved.
This release has been EOL for a long time, and is not even available from pretty much any distro. It is safe to remove this item.
ce3935f
to
724b2f3
Compare
@terminalmage That was my bad. A rebase wouldn't have fixed this. Apologies. |
@terminalmage A little lint to be fixed up here, please. |
Optimize file_tree ext_pillar and update file.managed to allow for binary contents
The contents/contents_pillar/contents_grains options assume that the contents
are string data, this pull request allows binary contents to be deployed.
Additionally, some changes have been made to file_tree to make reading in each
file more efficient. Finally, a usage example has been added to the FAQ.
Resolves #9569.