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 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 mchugh19 commented Apr 9, 2019

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

dwoz
dwoz approved these changes Apr 19, 2019
@dwoz
Copy link
Contributor

@dwoz dwoz commented Apr 19, 2019

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

@github-abcde
Copy link
Contributor Author

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

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

@github-abcde
Copy link
Contributor Author

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

@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
10 of 11 checks passed
@github-abcde github-abcde deleted the camels_and_snakes branch Apr 25, 2019
garethgreenaway added a commit to garethgreenaway/salt that referenced this issue Sep 19, 2019
@waynew waynew added this to PR needs port to master in PRs to port to master Oct 24, 2019
dwoz added a commit that referenced this issue Dec 20, 2019
@garethgreenaway garethgreenaway moved this from PR needs port to master to PR merged in PRs to port to master Mar 24, 2020
@garethgreenaway garethgreenaway moved this from PR merged to PR has port to master in PRs to port to master Mar 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
PRs to port to master
  
PR has port to master
Development

Successfully merging this pull request may close these issues.

None yet

4 participants