HEX
Server: LiteSpeed
System: Linux kapuas.iixcp.rumahweb.net 5.14.0-427.42.1.el9_4.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Nov 1 14:58:02 EDT 2024 x86_64
User: mirz4654 (1666)
PHP: 8.1.33
Disabled: system,exec,escapeshellarg,escapeshellcmd,passthru,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,popen,pclose,dl,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setsid,posix_setuid,posix_setpgid,ini_alter,show_source,define_syslog_variables,symlink,syslog,openlog,openlog,closelog,ocinumcols,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dll,ftp,myshellexec,socket_bind,mail,posix_getwpuid
Upload Files
File: //usr/lib/python3.9/site-packages/ansible/vars/__pycache__/clean.cpython-39.pyc
a

�)g��@s�ddlmZmZmZeZddlZddlZddlm	Z	m
Z
ddlmZ
ddlmZddlmZddlmZddlmZdd	lmZe�Zd
d�Zddd
�Zdd�Zdd�Zdd�ZdS)�)�absolute_import�division�print_functionN)�MutableMapping�MutableSequence)�	constants)�AnsibleError)�six)�to_text)�connection_loader)�DisplaycCsxt|t�r|��}t�|�}n$t|t�r>|dd�}t|�}n|S|D],\}}t|ttf�rjt|�||<qF|||<qF|S)a�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``
    N)�
isinstance�dict�copyr	Z	iteritems�list�	enumerate�module_response_deepcopy)�v�ret�items�key�value�r�6/usr/lib/python3.9/site-packages/ansible/vars/clean.pyrs



rcCs�|durt�}t|t�r>|D]}t|ttf�rt||d�qnvt|t�r�t|���D]L}t|tj�r~|�	d�r~||vr~||=qTt||ttf�rTt|||d�qTnt
dt|���|S)N)�
exceptions�	_ansible_z!Cannot strip invalid keys from %s)�tupler
rr�strip_internal_keysr�keysr	Zstring_types�
startswithr�type)Zdirtyr�element�krrrrFs 

rcCs�t|���D]<}|�d�r"|dks,|tjvrt�d|||f�||=qdD]}||vrN||sN||=qNt|�di����D]"}|�d�s�|�d�r~|d|=q~dS)	z5
    More nuanced version of strip_internal_keys
    rZ_ansible_parsedz9Removed unexpected internal key in module return: %s = %s)�warningsZdeprecations�
ansible_factsZdiscovered_interpreter_Zansible_discovered_interpreter_N)rrr�C�INTERNAL_RESULT_KEYS�display�warning�get)�datarrrr�remove_internal_keyscsr+cCs>t|�}t�}t|���}tjD]}|�|�tj|��q |�|�tj��tj	dd�D]b}t
j�t
j�
|��d}t�dt�|��}|D],}|�|�r�|�d�r�|�d�r�|�|�q�qZtjtjD]}	|	|vr�|�|	�q�t�d�}
|D]}|
�|�r�|�|�q�|D]&}|�d��st�d	|�||=�qt|�S)
zI remove facts that can override internal keys or otherwise deemed unsafe T)Z	path_onlyrz^ansible_%s_)Z_bridgeZ	_gwbridgeZansible_become_z^ansible_.*_interpreter$Zansible_ssh_host_key_z+Removed restricted key from module data: %s)r�setrr%ZMAGIC_VARIABLE_MAPPING�update�intersectionZCOMMON_CONNECTION_VARSr�all�os�path�splitext�basename�re�compile�escape�match�endswithr�addZRESTRICTED_RESULT_KEYSr&r'r(r)�factsr*Zremove_keysZ	fact_keysZ	magic_varZ	conn_pathZ	conn_nameZre_keyZfact_keyZhardZ	re_interpZr_keyrrr�clean_factsws0



r;cCsRi}|D]@}|�d�r8|dvr8t||�||dd�<qt||�||<qd|iS)z@ return all facts inside 'ansible_facts' w/o an ansible_ prefix Zansible_)Z
ansible_local�Nr$)rr)r:Z
deprefixedr"rrr�namespace_facts�sr=)N)Z
__future__rrrr Z
__metaclass__r0r4�collections.abcrrZansiblerr%Zansible.errorsrZansible.module_utilsr	Zansible.module_utils._textr
Zansible.plugins.loaderrZansible.utils.displayrr'rrr+r;r=rrrr�<module>s /
+