�
�Udac @` s� d d l m Z m Z m Z e Z d d l Z d d l m Z e d
d � Z
e d � Z e d � Z e d � Z
d � Z d � Z d S( i ( t absolute_importt divisiont print_functionN( t deepcopyc ` s� � � f d � � i } x� | j � D]� \ } } t | t � rn | | k rn t | � � | t | d � �<q% t | t � r� | | k r� � | � | t | d � �<q% | | t | d � �<q% W| S( s
reversible allows two way conversion of a camelized dict
such that snake_dict_to_camel_dict(camel_dict_to_snake_dict(x)) == x
This is achieved through mapping e.g. HTTPEndpoint to h_t_t_p_endpoint
where the default would be simply http_endpoint, which gets turned into
HttpEndpoint if recamelized.
ignore_list is used to avoid converting a sub-tree of a dict. This is
particularly important for tags, where keys are case-sensitive. We convert
the 'Tags' key but nothing below.
c ` su g } xh | D]` } t | t � r; | j t | � � � q
t | t � r` | j � | � � q
| j | � q
W| S( N( t
isinstancet dictt appendt camel_dict_to_snake_dictt list( t
camel_listt checked_listt item( t
reversiblet
value_is_list( sT /usr/lib/python2.7/site-packages/ansible/module_utils/common/dict_transformations.pyR
s
R ( t itemsR R R t _camel_to_snakeR ( t
camel_dictR t ignore_listt
snake_dictt kt v( ( R R
sT /usr/lib/python2.7/site-packages/ansible/module_utils/common/dict_transformations.pyR s
"c ` s t � f d � � � | | � S( s�
Perhaps unexpectedly, snake_dict_to_camel_dict returns dromedaryCase
rather than true CamelCase. Passing capitalize_first=True returns
CamelCase. The default remains False as that was the original implementation
c ` s� | d k r d St | � � } t | t � rb x~ | D]&