Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/vars/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/vars/clean.pyc

�
�Udac@`s�ddlmZmZmZeZddlZddlZddlm	Z
ddlmZddl
mZddlmZddlmZmZddlmZdd	lmZe�Zd
�Zdd�Zd�Zd
�Zd�ZdS(i(tabsolute_importtdivisiontprint_functionN(t	constants(tAnsibleError(tsix(tto_text(tMutableMappingtMutableSequence(tconnection_loader(tDisplaycC`s�t|t�r-|j�}tj|�}n)t|t�rR|}t|�}n|SxF|D]>\}}t|ttf�r�t|�||<q]|||<q]W|S(s�Function to create a deep copy of module response data

    Designed to be used within the Ansible "engine" to improve performance
    issues where ``copy.deepcopy`` was used previously, largely with CPU
    and memory contention.

    This only supports the following data types, and was designed to only
    handle specific workloads:

    * ``dict``
    * ``list``

    The data we pass here will come from a serialization such
    as JSON, so we shouldn't have need for other data types such as
    ``set`` or ``tuple``.

    Take note that this function should not be used extensively as a
    replacement for ``deepcopy`` due to the naive way in which this
    handles other data types.

    Do not expect uses outside of those listed below to maintain
    backwards compatibility, in case we need to extend this function
    to handle our specific needs:

    * ``ansible.executor.task_result.TaskResult.clean_copy``
    * ``ansible.vars.clean.clean_facts``
    * ``ansible.vars.namespace_facts``
    (t
isinstancetdicttcopyRt	iteritemstlistt	enumeratetmodule_response_deepcopy(tvtrettitemstkeytvalue((s6/usr/lib/python2.7/site-packages/ansible/vars/clean.pyRscC`s|dkrt�}nt|t�rcx�|D].}t|ttf�r.t|d|�q.q.Wn�t|t�r�x�t|j��D]s}t|tj	�r�|j
d�r�||kr�||=q�q�nt||ttf�r�t||d|�q�q�Wntdt|���|S(Nt
exceptionst	_ansible_s!Cannot strip invalid keys from %s(
tNonettupleRRRtstrip_internal_keysRtkeysRtstring_typest
startswithRttype(tdirtyRtelementtk((s6/usr/lib/python2.7/site-packages/ansible/vars/clean.pyREs 
	cC`s�xit|j��D]U}|jd�r4|dksC|tjkrtjd|||f�||=qqWx5ddgD]'}||kry||ry||=qyqyWxRt|jdi�j��D]2}|jd�s�|jd�r�|d|=q�q�Wd	S(
s5
    More nuanced version of strip_internal_keys
    Rt_ansible_parseds9Removed unexpected internal key in module return: %s = %stwarningstdeprecationst
ansible_factstdiscovered_interpreter_tansible_discovered_interpreter_N(RRRtCtINTERNAL_RESULT_KEYStdisplaytwarningtget(tdataR((s6/usr/lib/python2.7/site-packages/ansible/vars/clean.pytremove_internal_keysbs*%c
C`sFt|�}t�}t|j��}x.tjD]#}|j|jtj|��q1W|j|jtj��x�tj	dt
�D]�}y�tjj
tjj|��d}tjd|�}xL|D]D}|j|�r�|jd�s�|jd�r�|j|�q�q�WWq�tk
r%q�Xq�Wx4tjtjD]"}	|	|kr;|j|	�q;q;Wtjd�}
x-|D]%}|
j|�rw|j|�qwqwWx�|D]�}|jd�s�yAt||�}t|�d	kr�d
|d |df}nWntk
rd
}nXtjd||f�||=q�q�Wt|�S(sI remove facts that can override internal keys or otherwise deemed unsafe t	path_onlyis^ansible_%s_t_bridget	_gwbridgetansible_become_s^ansible_.*_interpreter$tansible_ssh_host_key_is	%s ... %si
i����s' <failed to convert value to a string> s0Removed restricted key from module data: %s = %s(R1R2(RtsetRR)tMAGIC_VARIABLE_MAPPINGtupdatetintersectiontCOMMON_CONNECTION_VARSR	talltTruetostpathtsplitexttbasenametretcompiletmatchtendswithRtaddtAttributeErrortRESTRICTED_RESULT_KEYSR*Rtlent	ExceptionR+R,R(
tfactsR.tremove_keyst	fact_keyst	magic_vart	conn_patht	conn_nametre_keytfact_keythardt	re_interptr_keytr_val((s6/usr/lib/python2.7/site-packages/ansible/vars/clean.pytclean_factsvsB	!"
.




cC`sli}xX|D]P}|jd�rI|dkrIt||�||d<q
t||�||<q
Wi|d6S(s@ return all facts inside 'ansible_facts' w/o an ansible_ prefix tansible_t
ansible_localiR&(RW(RR(RIt
deprefixedR"((s6/usr/lib/python2.7/site-packages/ansible/vars/clean.pytnamespace_facts�s
(t
__future__RRRRt
__metaclass__R<R@tansibleRR)tansible.errorsRtansible.module_utilsRtansible.module_utils._textRt/ansible.module_utils.common._collections_compatRRtansible.plugins.loaderR	tansible.utils.displayR
R+RRRR/RURY(((s6/usr/lib/python2.7/site-packages/ansible/vars/clean.pyt<module>s 		/		4

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]