The ec2 module_utils have a function called camel_dict_to_snake_dict

If you are using Ansible 2.1, modules can import specific things from
module_utils, so you could use:

from ansible.module_utils.ec2 import camel_dict_to_snake_dict

Not sure if there is anything to be cautious of, but it may work for you.


On Tuesday, June 7, 2016, Tim <[email protected]> wrote:

> hey folks,
>
> I'm making a module, and have a REST api that I'm working with that
> returns all its values in camelCase and I wanted to return them in a module
> to my end users in the snake_case that ansible uses.
>
> I was wondering if Ansible came with a utility method to do this, or if I
> should back my own?
>
> Thanks,
> tim
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ansible Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected]
> <javascript:_e(%7B%7D,'cvml','ansible-devel%[email protected]');>
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Matt Martz
@sivel
sivel.net

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to