-
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
Camels and snakes #52458
Merged
Merged
Camels and snakes #52458
Conversation
This file contains 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
…(with Jinja decorators).
…ons and replaced them with the added functions in salt.utils.stringutils.
@github-abcde This looks good. Can we get some tests for the two new salt util functions? |
Isn't there a docs page for Jinja filters as well? |
twangboy
approved these changes
Apr 10, 2019
dwoz
approved these changes
Apr 19, 2019
@github-abcde can you reply to @mchugh19's comment please? |
twangboy
approved these changes
Apr 25, 2019
garethgreenaway
added a commit
to garethgreenaway/salt
that referenced
this pull request
Sep 19, 2019
dwoz
added a commit
that referenced
this pull request
Dec 20, 2019
[master] Porting #52458 to master
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?
Add
camel_to_snake_case
andsnake_to_camel_case
functions tosalt.utils.stringutils
with decorators to also be able to use them as Jinja filters.The only other place that this functionality already existed (be it with a slightly different name) was in
states/testinframod.py
andmodules/testinframod.py
, which have been updated to use the functions insalt.utils.stringutils
instead.What issues does this PR fix or reference?
None
Previous Behavior
No publicly available functions to convert between snake_case and camelCase (or UpperCamelCase) were available in salt or Jinja.
New Behavior
These functions are now available to use in other modules (most notably Boto modules could benefit from this as Boto (and AWS) use UpperCamelCasing for almost all of their parameters and function names).
Tests written?
Yes
Commits signed with GPG?
Yes