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: //lib/python3.9/site-packages/ansible/plugins/action/__pycache__/fetch.cpython-39.pyc
a

�)g�&�@s�ddlmZmZmZeZddlZddlZddlm	Z	m
Z
mZddlm
Z
mZddlmZddlmZddlmZddlmZdd	lmZmZmZmZdd
lmZmZe�ZGdd�de�Z dS)
�)�absolute_import�division�print_functionN)�AnsibleError�AnsibleActionFail�AnsibleActionSkip)�to_bytes�to_text)�string_types)�boolean)�
ActionBase)�Display)�checksum�
checksum_s�md5�secure_hash)�
makedirs_safe�
is_subpathcseZdZd�fdd�	Z�ZS)�ActionModuleNcs`|durt�}tt|��||�}~�z$|jjr6td��|jj�	dd�}|jj�	dd�}}t
|jj�	d�dd�}t
|jj�	dd	�dd�}t
|jj�	d
d	�dd�}	d}
t|t�s�d}
t|t�s�d
}
|dus�|dur�d}
|
r�t
|
��|jj�|�}|�|�}i}d}|jj�sz|j||d	d�}Wn|t�y�}
zbd|d<||d<|�r\d	|d<t|
�|d<ndt|
dd�|d<|WYd}
~
W|�|jjj�Sd}
~
00|�	d�}|�	d��r|�	d��rd	|d<d|d<d|d<|�s�|dd7<|d=|d=|W|�|jjj�Sd}|dv�r�|jdt|d�|d�}|�	d��r�|�sV||d<d|d<n
|�|�d |�	dd�v�r|d!|d<n|�	dd��d"��r�d|d<|W|�|jjj�S|d#d$k�r�t�|d%�}|du�r�t|�}tjj |jj�d&d�v�r|jj�!|�}|�"d'd(�}n|}t#||��s2t
d)||f��|�r�tj�$t%|d*d���rd|�&tj ��sdt
d+��|�&tj ��r�tj�'|�}tj�(||�}|�d(��s�|j)�*|�}n2d,|v�r�|d,}n|jj+}d-|j)�*|�||f}tj�,|�}t-|�}||k�r�t.tj�/|��|du�r |j�0||�n`z(t1t%|d*d�d.�}|�2|�|�3�Wn6t4t5f�y~}zt
d/|��WYd}~n
d}~00t6|�}zt7|�}Wnt8�y�d}Yn0|	�r�||k�r�|�td	|d0||d||d1��n|�d	||d||d2��n>zt7|�}Wnt8�yd}Yn0|�td||||d3��W|�|jjj�n|�|jjj�0|S)4z handler for fetch operations Nz.check mode not (yet) supported for this module�src�dest�flatF)�strict�fail_on_missingT�validate_checksum�z<Invalid type supplied for source option, it must be a stringz:Invalid type supplied for dest option, it must be a stringzsrc and dest are required)Zall_vars�follow�changed�file�failed�msgz%s, ignoredZsurrogate_or_replace)�errorsr�exists�isdirz<remote file is a directory, fetch cannot work on directoriesz, not transferring, ignored)N�1rzansible.legacy.slurp)r)Zmodule_nameZmodule_args�	task_varsz	not foundz9the remote file does not exist, not transferring, ignoredzsource is a directory�encoding�base64Zcontent�a�\�/zKDetected directory traversal, expected to be contained in '%s' but got '%s'Zsurrogate_or_strictz`dest is an existing directory, use a trailing slash if you want to fetch src into that directoryZinventory_hostnamez%s/%s/%s�wbzFailed to fetch the file: %szchecksum mismatch)r�md5sumr rr�
remote_md5sumr�remote_checksum)rr,rr-rr.)rr,rrr)9�dict�superr�runZ
_play_contextZ
check_moderZ_task�args�getr�
isinstancer
rZ_connectionZ_shellZ	join_pathZ_remote_expand_userZbecomeZ_execute_remote_statrr	Z_remove_tmp_pathZtmpdirZ_execute_module�update�
startswithr'Z	b64decoder�os�path�sepZ_unquote�replacerr#r�endswith�basename�joinZ_loaderZ	path_dwimZremote_addr�normpathrr�dirnameZ
fetch_file�open�write�close�IOError�OSErrorrr�
ValueError)�self�tmpr%�result�sourceZ
original_destrrrrr Zremote_statr.ZaeZremote_dataZslurpresZsource_local�baseZtarget_nameZlocal_checksum�f�eZnew_checksumZnew_md5Z	local_md5��	__class__��@/usr/lib/python3.9/site-packages/ansible/plugins/action/fetch.pyr1$s�



v�
c�



Q�
$




"

�

�

$zActionModule.run)NN)�__name__�
__module__�__qualname__r1�
__classcell__rOrOrMrPr"sr)!Z
__future__rrr�typeZ
__metaclass__r7r'Zansible.errorsrrrZ+ansible.module_utils.common.text.convertersrr	Zansible.module_utils.sixr
Z)ansible.module_utils.parsing.convert_boolrZansible.plugins.actionrZansible.utils.displayr
Zansible.utils.hashingrrrrZansible.utils.pathrrZdisplayrrOrOrOrP�<module>s