%PDF- %PDF-
Mini Shell

Mini Shell

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

a

�)gC$�@sRddlmZmZmZeZddlZddlZddl	m
Z
mZddlm
Z
mZddlmZddlmZmZddlmZddlmZdd	lmZzdd
lmZdZWney�dZYn0e�Zd
d�Z dd�Z!dd�Z"dd�Z#dd�Z$dd�Z%dd�Z&dd�Z'd/dd �Z(d!d"�Z)d0d#d$�Z*d1d%d�Z+d2d'd(�Z,d3d)d*�Z-d4d+d,�Z.Gd-d.�d.e/�Z0dS)5�)�absolute_import�division�print_functionN)�MutableMapping�MutableSequence)�LooseVersion�
StrictVersion��errors)�	to_native�to_text)�boolean)�Display)�SemanticVersion)�VersionTFcCs t|t�st�d��|�dd�S)z# Test if task result yields failed z&The 'failed' test expects a dictionary�failedF��
isinstancerr
�AnsibleFilterError�get��result�r�=/usr/lib/python3.9/site-packages/ansible/plugins/test/core.pyr,s

rcCs
t|�S)z$ Test if task result yields success )rrrrr�success3srcCs t|t�st�d��|�dd�S)z( Test if task result yields unreachable z+The 'unreachable' test expects a dictionary�unreachableFrrrrrr8s

rcCs
t|�S)z& Test if task result yields reachable )rrrrr�	reachable?srcCs|t|t�st�d��d|vrld}d|vrxt|dt�rxt|ddt�rx|dD]}|�dd�rPd}qxqPn|�dd�}|S)z$ Test if task result yields changed z'The 'changed' test expects a dictionary�changedF�resultsrT)rrr
rrr)rr�resrrrrDs 

���rcCs t|t�st�d��|�dd�S)z$ Test if task result yields skipped z'The 'skipped' test expects a dictionary�skippedFrrrrrr Xs

r cCs>t|t�st�d��d|vr,|�dd�dkSt�d�dSdS)z  Test if async task has started z'The 'started' test expects a dictionary�startedr�zIThe 'started' test expects an async task, but a non-async task was testedTN�rrr
rr�displayZwarningrrrrr!_s


r!cCs>t|t�st�d��d|vr,|�dd�dkSt�d�dSdS)z! Test if async task has finished z(The 'finished' test expects a dictionary�finishedrr"zJThe 'finished' test expects an async task, but a non-async task was testedTNr#rrrrr%ms


r%��searchcCsNt|dd�}d}|r|tjO}|r,|tjO}tj||d�}tt||d�|��S)z� Expose `re` as a boolean filter using the `search` method by default.
        This is likely only useful for `search` and `match` which already
        have their own filters.
    Zsurrogate_or_strictr	r)�flagsr')r�re�I�M�compile�bool�getattr)�value�pattern�
ignorecase�	multilineZ
match_typer(�_rerrr�regex{s

r4cCst|dd�o|��S)z^Evaulate whether a variable is a single vault encrypted value

    .. versionadded:: 2.10
    Z
__ENCRYPTED__F)r.Zis_encrypted)r/rrr�vault_encrypted�sr5cCst||||d�S)z* Perform a `re.match` returning a boolean �match�r4�r/r0r1r2rrrr6�sr6cCst||||d�S)z+ Perform a `re.search` returning a boolean r'r7r8rrrr'�s�eqc
Csbddddddddddddddd�}tttttd�}|d	urL|d	urLt�d
��|sZt�d��|sht�d��|d
kr~ts~t�d��t}|r�t}nB|r�z||}Wn0ty�t�d|d�t	t
|��f��Yn0||vr�||}nt�d|d�t	t
|��f��z&tt|�}||t
|��|t
|���WSt�y\}	zt�dt|	���WYd	}	~	n
d	}	~	00d	S)z) Perform a version comparison on a value r9�lt�le�gt�ge�ne)z==�=r9�<r:z<=r;�>r<z>=r=z!=z<>r>)Zloose�strictZsemverZsemantic�pep440Nz/Cannot specify both 'strict' and 'version_type'z#Input version value cannot be emptyz4Version parameter to compare against cannot be emptyrCz?The pep440 version_type requires the Python 'packaging' libraryz,Invalid version type (%s). Must be one of %sz, z-Invalid operator type (%s). Must be one of %szVersion comparison failed: %s)rrr�
PEP440Versionr
r�
HAS_PACKAGING�KeyError�join�map�reprr.�py_operatorr�	Exceptionr)
r/�version�operatorrBZversion_typeZop_mapZtype_mapr�method�errr�version_compare�sR�
�



�

�
rPcCs,|r$zt|�}Wnty"Yn0t|�S)z�Evaluate as value for truthiness using python ``bool``

    Optionally, attempt to do a conversion to bool from boolean like values
    such as ``"false"``, ``"true"``, ``"yes"``, ``"no"``, ``"on"``, ``"off"``, etc.

    .. versionadded:: 2.10
    )r
�	TypeErrorr-�r/�convert_boolrrr�truthy�srTcCst||d�S)z�Evaluate as value for falsiness using python ``bool``

    Optionally, attempt to do a conversion to bool from boolean like values
    such as ``"false"``, ``"true"``, ``"yes"``, ``"no"``, ``"on"``, ``"off"``, etc.

    .. versionadded:: 2.10
    )rS)rTrRrrr�falsy�srUc@seZdZdZdd�ZdS)�
TestModulez Ansible core jinja2 tests cCs4ttttttttttttttt	t
tttt
tttd�S)N)rZfailureZ	succeededrZ
successfulrrrZchanger �skipr%r!r6r'r4rPrL�any�allrTrUr5)rrrrrr r%r!r6r'r4rPrXrYrTrUr5)�selfrrr�tests�s0�zTestModule.testsN)�__name__�
__module__�__qualname__�__doc__r[rrrrrV�srV)r&r&FFr')r&FF)r&FF)r9NN)F)F)1Z
__future__rrr�typeZ
__metaclass__r)rMrJ�collections.abcrrZ#ansible.module_utils.compat.versionrrZansibler
Zansible.module_utils._textrrZ)ansible.module_utils.parsing.convert_boolr
Zansible.utils.displayrZansible.utils.versionrZpackaging.versionrrDrE�ImportErrorr$rrrrrr r!r%r4r5r6r'rPrTrU�objectrVrrrr�<module>s@




8



Zerion Mini Shell 1.0