Skip to content
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

Merged
merged 5 commits into from
Jan 12, 2016

Conversation

terminalmage
Copy link
Contributor

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.

@cachedout
Copy link
Contributor

@terminalmage Could you please rebase and fix some lint? Thanks.

@terminalmage
Copy link
Contributor Author

@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
Copy link
Contributor

Choose a reason for hiding this comment

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

are made are made

Copy link
Contributor Author

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.
@cachedout
Copy link
Contributor

@terminalmage That was my bad. A rebase wouldn't have fixed this. Apologies.

@cachedout
Copy link
Contributor

@terminalmage A little lint to be fixed up here, please.

@cachedout cachedout added the pending-changes The pull request needs additional changes before it can be merged label Jan 12, 2016
cachedout pushed a commit that referenced this pull request Jan 12, 2016
Optimize file_tree ext_pillar and update file.managed to allow for binary contents
@cachedout cachedout merged commit 4a6b53f into saltstack:2015.8 Jan 12, 2016
@terminalmage terminalmage removed the pending-changes The pull request needs additional changes before it can be merged label Jan 12, 2016
@terminalmage terminalmage deleted the issue9569 branch February 3, 2016 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants