%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/executor/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/executor/__pycache__/interpreter_discovery.cpython-39.pyc

a

�)g�&�@s�ddlmZmZmZeZddlZddlZddlZddl	Z	ddl
mZddl
mZmZddlmZddlmZddlmZddlmZdd	lmZdd
lmZdd�ej��D�Ze�Ze	� d
�Z!Gdd�de"�Z#dd�Z$dd�Z%dd�Z&dS)�)�absolute_import�division�print_functionN)�	constants)�	to_native�to_text)�LinuxDistribution)�Display)�get_versioned_doclink��LooseVersion)�Distribution)�
format_exccCsi|]\}}|��|���qS�)�lower)�.0�k�vrr�J/usr/lib/python3.9/site-packages/ansible/executor/interpreter_discovery.py�
<dictcomp>�rz((?s)PLATFORM[\r\n]+(.*)FOUND(.*)ENDFOUNDcs,eZdZ�fdd�Zdd�Zdd�Z�ZS)�!InterpreterDiscoveryRequiredErrorcs tt|��|�||_||_dS�N)�superr�__init__�interpreter_name�discovery_mode)�self�messagerr��	__class__rrrsz*InterpreterDiscoveryRequiredError.__init__cCs|jSr�r�rrrr�__str__!sz)InterpreterDiscoveryRequiredError.__str__cCs|jSrr!r"rrr�__repr__$sz*InterpreterDiscoveryRequiredError.__repr__)�__name__�
__module__�__qualname__rr#r$�
__classcell__rrrrrsrcCs�|dkrtd�|���|�dd�}d}d}dg}|�d�}|�d�}	�z�tjjd|d	�}
tjjd
|d	�}tj	d�|�|d�d
d�|D�}d�d�
|��}
|j|
dd�}|�dd�}t�
|�}|s�tjd�|�|d�td��|��d����}dd�|��d��D�}tjd�|�|d�|�sF|	�s@|j�d�||��WdS|dk�rbtd�t|����t�dd �}|jj�r�|j|dd|d!�}ntd"��t�|�d��}t|�\}}|�r�|�s�td#��t�|�����}|
�|������p�|
�|�}|�s
td$�|���tt ||�d%d&�}|�r`|dk�r`d|v�r`|	�sZ|j�d'�||||t!d(���WdS||v�r�||v�r�|	�s�|j�d)�||��|	�s�|j�d*�|||||dt!d(���|dWS|WSt�y}z$tj	d+�t|��|d�WYd}~n�d}~0t"�y�}zt|	�s|tj#d,�|t|��d-�tjd.�tt$���|d�|�r||�d/��r|tj	d0�t|�d/���|d�WYd}~n
d}~00|	�s�|j�d1�|||dt!d(���|dS)2NZpythonz+Interpreter discovery not supported for {0}Zinventory_hostname�unknownz/usr/bin/pythonZauto_legacyZ_silentZ_INTERPRETER_PYTHON_DISTRO_MAP)Z	variablesZINTERPRETER_PYTHON_FALLBACKz$Attempting {0} interpreter discovery)�msg�hostcSsg|]}d|�qS)zcommand -v '%s'r)r�pyrrr�
<listcomp>Crz(discover_interpreter.<locals>.<listcomp>z4echo PLATFORM; uname; echo FOUND; {0}; echo ENDFOUNDz; F)�sudoable�stdout�z%raw interpreter discovery output: {0})r+z3unexpected output from Python interpreter discoveryrcSsg|]}|�d�r|���qS)�/)�
startswith�strip)rZinterprrrr-Sr�zfound interpreters: {0}z5No python interpreters found for host {0} (tried {1})Zlinuxz0unsupported platform for extended discovery: {0}zansible.executor.discoveryzpython_target.py)r.Zin_dataz>pipelining support required for extended interpreter discoveryz-unable to get Linux distribution/version infoz#unsupported Linux distribution: {0}Zsurrogate_or_strict)�errorsz�Distribution {0} {1} on host {2} should use {3}, but is using /usr/bin/python for backward compatibility with prior Ansible releases. See {4} for more informationz/reference_appendices/interpreter_discovery.htmlzCPlatform interpreter {0} on host {1} is missing from bootstrap listz�Distribution {0} {1} on host {2} should use {3}, but is using {4}, since the discovered platform python interpreter was not present. See {5} for more information.z+Python interpreter discovery fallback ({0})zAUnhandled error in Python interpreter discovery for host {0}: {1})r*z$Interpreter discovery traceback:
{0}�stderrz(Interpreter discovery remote stderr:
{0}z�Platform {0} on host {1} is using the discovered Python interpreter at {2}, but future installation of another Python interpreter could change the meaning of that path. See {3} for more information.)%�
ValueError�format�getr2�endswith�CZconfigZget_config_value�displayZvvv�joinZ_low_level_execute_command�foundre�match�debug�groupsrr3�
splitlinesZ_discovery_warnings�append�NotImplementedErrorr�pkgutil�get_dataZ_connectionZhas_pipelining�json�loads�_get_linux_distro�OS_FAMILY_LOWERr�_version_fuzzy_matchr
�	ExceptionZwarningr)�actionrrZ	task_varsr+�resZ
platform_typeZfound_interpretersZis_auto_legacyZ	is_silentZplatform_python_mapZbootstrap_python_listZcommand_listZshell_bootstrapZ
raw_stdoutr?Zplatform_script�
platform_infoZdistro�versionZfamily�version_mapZplatform_interpreter�exrrr�discover_interpreter)s�	



�

��

����
,4
��rScCsd|�dg�}t|�dkr0t|�r0|d|dfS|�d�}|sBdSt�|�}|�dd�|�d	d�fS)
NZplatform_dist_result�rr4�osrelease_content)r0r0�idr0Z
version_id)r9�len�anyrZ_parse_os_release_content)rOZdist_resultrUZosrrrrrI�s

rIcCsh|�|�}|r|Stdd�|��D��}t|�}t�||�}|dkrT|�|dj�S|�||dj�S)NcSsg|]}t|��qSrr)rrrrrr-�rz(_version_fuzzy_match.<locals>.<listcomp>rr4)r9�sorted�keysr�bisectZvstring)rPrQrNZsorted_looseversionsZfind_looseversionZkposrrrrK�s
rK)'Z
__future__rrr�typeZ
__metaclass__r[rGrE�reZansiblerr;Zansible.module_utils._textrrZansible.module_utils.distrorZansible.utils.displayr	Zansible.utils.plugin_docsr
Z#ansible.module_utils.compat.versionrZ.ansible.module_utils.facts.system.distributionr
�	tracebackrZ	OS_FAMILY�itemsrJr<�compiler>rLrrSrIrKrrrr�<module>s*


Zerion Mini Shell 1.0