관리-도구
편집 파일: script.cpython-39.pyc
a �����)g6����������������������@���s����d�dl�mZmZmZ�eZd�dlZd�dlZd�dlZd�dl m Z mZmZm Z mZ�d�dlmZ�d�dlmZmZmZ�d�dlmZ�G�dd��de�ZdS�) �����)�absolute_import�division�print_functionN)�AnsibleError� AnsibleAction�_AnsibleActionDone�AnsibleActionFail�AnsibleActionSkip)�module_manifest)�to_bytes� to_native�to_text)� ActionBasec�����������������������s,���e�Zd�ZdZe�d�Zd��fdd� Z���ZS�)�ActionModuleTz^(?:[a-zA-Z]\:)?(\\|\/)Nc��������������������sz��|du�rt���}tt|���||�}~�z>�z�|�jj�d�}|rR|��|�rRtd|���|�jj�d�}|rz|��|�sztd|���|�jj�d�}|r�t |�j jdd�r�|�j� |�s�td |���t |�j jdd�s�|�d �s�td|���t|�jj�dd �dd�}dd��t�|����D��}|d�} t|�jj�dd �dd�} z(|�jj|��d| �|�jj�dd�d�} W�n2�t�y��}�ztt|���W�Y�d}~n d}~0�0�|�jj�r�|�jj�d��s�|�jj�d��r�d|d<�t|d��nd|d<�td|d��d|d<�|�j j�|�j jjtj�| ��}t|����� |d�|�} |��!| |��|�j"|�j jj|fdd��t���}|��#|�}| �rbd�$|| | g�}nd�$|| g�}|�j j�%|�}d}t |�j jdd��r�|�j&}t'�(t)|�| i�||�jj*|j+|j,|j-|j.|j/d|d� }|�j jj0d dd d�}|�1|�j2||d|d ���d!|v��r|d!�dk�rtd"��W�n2�t3�yN�}�z|�1|j4��W�Y�d}~n d}~0�0�W�|��5|�j jj��n|��5|�j jj��0�|S�)#z& handler for file transfer operations N�createsz"%s exists, matching creates option�removesz*%s does not exist, matching removes option�chdirZ_IS_WINDOWSFz;chdir %s must be an absolute path for a Windows remote node�/z>chdir %s must be an absolute path for a Unix-aware remote nodeZ_raw_params���surrogate_or_strict��errorsc�����������������S���s���g�|�]}t�|d�d��qS�)r���r���)r ���)�.0�s��r����A/usr/lib/python3.9/site-packages/ansible/plugins/action/script.py� <listcomp>O��������z$ActionModule.run.<locals>.<listcomp>r���� executable�files�decryptT)r ���Zchanged)�resultz*Check mode is not supported for this task.)Zexecute� Zscriptz#!powershell)� env_stringZshebang�cmd)r$���Zin_dataZsudoabler����rcznon-zero return code)6�dict�superr����runZ_task�args�getZ_remote_file_existsr ����getattrZ_connectionZ_shell�windows_absolute_path_detection�matchr���� startswithr����shlex�split�stripZ_loaderZ get_real_fileZ_find_needler���Z check_moder���Z join_pathZtmpdir�os�path�basenamer ����replaceZ_transfer_fileZ _fixup_perms2Z_compute_environment_string�joinZ wrap_for_execZ _play_context�ps_manifestZ_create_powershell_wrapperr���Z async_valZbecomeZ become_methodZbecome_userZbecome_passZbecome_flagsZbuild_module_command�updateZ_low_level_execute_commandr���r!���Z_remove_tmp_path)�self�tmpZ task_varsr!���r���r���r���Z raw_params�parts�sourcer����eZtmp_srcZtarget_commandZenv_dictr#���Z script_cmdZ exec_dataZpc�� __class__r���r���r(���&���s����� �(" � �$$zActionModule.run)NN) �__name__� __module__�__qualname__ZTRANSFERS_FILES�re�compiler,���r(���� __classcell__r���r���r>���r���r������s��� r���)Z __future__r���r���r����typeZ __metaclass__r2���rC���r/���Zansible.errorsr���r���r���r���r ���Zansible.executor.powershellr ���r7���Zansible.module_utils._textr���r���r ���Zansible.plugins.actionr���r���r���r���r���r����<module>���s���