관리-도구
편집 파일: galaxy.cpython-39.opt-1.pyc
a �����)gJ����������������������@���s����d�dl�mZmZmZ�eZd�dlZd�dlZd�dlm Z m Z �d�dlZd�dlm Z�d�dlmZ�d�dlmZ�d�dlmZ�d�dlmZ�d�dlmZmZ�e��Zdd d�Zddd�ZdS�)�����)�absolute_import�division�print_functionN)�Popen�PIPE)�context)�AnsibleError)�Display)�get_bin_path)�to_text� to_native�HEADc�����������������C���s���t�|�d||dd�S�)N�gitF)�scm�name�version� keep_scm_meta)�scm_archive_resource)�srcr���r�����r����8/usr/lib/python3.9/site-packages/ansible/utils/galaxy.py�scm_archive_collection&���s����r���r���Fc�������������� ���C���s��dd��}|dvrt�d|���zt|�}W�n(�tttfyP���t�d||�f���Y�n0�tjtjd�}|dg}t j d�} | r�|d kr�|�d dg��n|dkr�|�d ��|�|�|g��|||��|d kr�|r�|dt |�g} || tj�||���tjddtjd�}d�}|�rbt�d|||jf���t�|jd��(} | jtj�||�|d��W�d�����n1��sV0����Y��nx|dk�r�|ddd|�g}|�r�|�d|g��|�|j��n<|d k�r�|dd|�d|j�g}|�r�|�|��n |�d��|d�u�rt�d|���||tj�||���|jS�)Nc�������������� ���S���s����z(d}d}t�|�|ttd�}|���\}}W�nP�tyx�}�z8d�|��}t�d|���td|t|�f���W�Y�d�}~n d�}~0�0�|j dkr�tdd�|��||j t|�f���d�S�)N��)�cwd�stdout�stderr� zran %s:zwhen executing %s: %sr���z0- command %s failed in directory %s (rc=%s) - %s) r���r���Zcommunicate� Exception�join�display�debugr���r���� returncode)�cmd�tempdirr���r����popen�eZranr���r���r����run_scm_cmd,���s���� * z)scm_archive_resource.<locals>.run_scm_cmd)�hgr���z#- scm %s is not currently supportedzDcould not find/use %s, it is required to continue with installing %s)�dirZclone�ignore_certsr���z-czhttp.sslVerify=falser'���z --insecureZcheckoutFz.tar)�delete�suffixr(���ztarring %s from %s to %s�w)Zarcname�archivez--prefixz%s/z-rz--prefix=%s/z--output=%sr ���zarchiving %s)r���r ���� ValueError�OSError�IOError�tempfileZmkdtemp�CZDEFAULT_LOCAL_TMPr���ZCLIARGS�extend�appendr����os�pathr���ZNamedTemporaryFiler���Zvvvr����tarfile�open�add)r���r���r���r���r���r&���Zscm_pathr#���Z clone_cmdr)���Zcheckout_cmdZ temp_fileZarchive_cmd�tarr���r���r���r���*���sP���� : r���)Nr ���)r���Nr ���F)Z __future__r���r���r����typeZ __metaclass__r5���r1���� subprocessr���r���r7���Zansible.constantsZ constantsr2���Zansibler���Zansible.errorsr���Zansible.utils.displayr ���Z#ansible.module_utils.common.processr ���Z+ansible.module_utils.common.text.convertersr���r���r���r���r���r���r���r���r����<module>���s���