Skip to content

Camels and snakes - #52458

Merged
twangboy merged 10 commits into
saltstack:developfrom
basisbeeld:camels_and_snakes
Apr 25, 2019
Merged

Camels and snakes#52458
twangboy merged 10 commits into
saltstack:developfrom
basisbeeld:camels_and_snakes

Conversation

@github-abcde

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

Copy link
Copy Markdown
Contributor

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

twangboy commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

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

@mchugh19

mchugh19 commented Apr 9, 2019

Copy link
Copy Markdown
Contributor

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

@dwoz

dwoz commented Apr 19, 2019

Copy link
Copy Markdown
Contributor

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

@github-abcde

Copy link
Copy Markdown
Contributor Author

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

@github-abcde

Copy link
Copy Markdown
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.

6 participants