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

Camels and snakes #52458

Merged
merged 10 commits into from
Apr 25, 2019
Merged

Camels and snakes #52458

merged 10 commits into from
Apr 25, 2019

Conversation

github-abcde
Copy link
Contributor

@github-abcde github-abcde commented Apr 9, 2019

What does this PR do?

Add camel_to_snake_case and snake_to_camel_case functions to salt.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 and modules/testinframod.py, which have been updated to use the functions in salt.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

@twangboy
Copy link
Contributor

twangboy commented Apr 9, 2019

@github-abcde This looks good. Can we get some tests for the two new salt util functions?

@mchugh19
Copy link
Contributor

mchugh19 commented Apr 9, 2019

Isn't there a docs page for Jinja filters as well?

@dwoz
Copy link
Contributor

dwoz commented Apr 19, 2019

@github-abcde can you reply to @mchugh19's comment please?

@github-abcde
Copy link
Contributor Author

@mchugh19 There is, and I've added documentation in commit 43896e2

@github-abcde
Copy link
Contributor Author

@mchugh19 or @dwoz Is there something else that I can (or need to) do in order for this branch to be merged?

@twangboy twangboy merged commit e6dcc52 into saltstack:develop Apr 25, 2019
@github-abcde github-abcde deleted the camels_and_snakes branch April 25, 2019 17:19
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants