%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3.9/site-packages/ansible/playbook/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3.9/site-packages/ansible/playbook/__pycache__/task_include.cpython-39.opt-1.pyc

a

�)g��@s�ddlmZmZmZeZddlmZddl	m
Z
ddlmZddl
mZddlmZddlmZdgZe�ZGd	d�de�ZdS)
�)�absolute_import�division�print_functionN)�AnsibleParserError)�Block)�Task)�Display)�Sentinel�TaskIncludecs�eZdZdZed�Zed�Ze�e�Zed�Z	d�fdd�	Z
eddd	��Zd
d�Z
�fdd
�Zd�fdd�	Z�fdd�Zdd�Z�ZS)r
z�
    A task include is derived from a regular task to handle the special
    circumstances related to the `- include: ...` task.
    )�file�_raw_params)�apply)�action�args�collectionsZdebugger�
ignore_errorsZloopZloop_controlZ	loop_with�nameZno_log�registerZrun_once�tags�timeout�vars�whenNcs tt|�j|||d�d|_dS)N��block�role�task_includeF)�superr
�__init__�statically_loaded)�selfrrr��	__class__��A/usr/lib/python3.9/site-packages/ansible/playbook/task_include.pyr0szTaskInclude.__init__cCs*t|||d�}|�|j|||d�|�}|S)Nr)�variable_manager�loader)r
�
check_optionsZ	load_data)�datarrrr$r%Zti�taskr"r"r#�load4s�zTaskInclude.loadcCs�t|j���}|�|j�}|rJ|jtjvrJtd|jd�	t
|��f|d��|j�d�s�|j�dd�|jd<|jds�td|j��|j�di�}|r�|jtj
vr�td	|j|d��nt|t�s�td
t|�|d��|S)aV
        Method for options validation to use in 'load_data' for TaskInclude and HandlerTaskInclude
        since they share the same validations. It is not named 'validate_options' on purpose
        to prevent confusion with '_validate_*" methods. Note that the task passed might be changed
        as a side-effect of this method.
        zInvalid options for %s: %s�,��objrrNzNo file specified for %sr
zInvalid options for %s: applyz,Expected a dict for apply but got %s instead)�	frozensetr�keys�
difference�
VALID_ARGSr�CZ'_ACTION_ALL_PROPER_INCLUDE_IMPORT_TASKSr�join�list�get�popZ_ACTION_INCLUDE_TASKS�
isinstance�dict�type)rr(r'Zmy_arg_namesZbad_opts�apply_attrsr"r"r#r&>s 

zTaskInclude.check_optionscsztt|��|�}t|����|j�}|D]L}||tur(|dtj	vr(tj
rftd||jj
f|d��q(t�d|�q(|S)Nrz&'%s' is not a valid attribute for a %sr+zIgnoring invalid attribute: %s)rr
�preprocess_data�setr.r/�VALID_INCLUDE_KEYWORDSr	r1Z_ACTION_ALL_INCLUDE_ROLE_TASKSZINVALID_TASK_ATTRIBUTE_FAILEDrr!�__name__�displayZwarning)rZds�diff�kr r"r#r:YszTaskInclude.preprocess_dataFcs tt|�j||d�}|j|_|S)N)�exclude_parent�
exclude_tasks)rr
�copyr)rrArBZnew_mer r"r#rCgszTaskInclude.copycsj|jtjvrtt|���}nJt�}|jr6||j��O}||jO}||j	O}d|vrX|d=d|vrf|d=|S)z�
        We override the parent Task() classes get_vars here because
        we need to include the args of the include into the vars as
        they are params to the included tasks. But ONLY for 'include'
        rr)
rr1Z_ACTION_INCLUDErr
�get_varsr7�_parentrr)rZall_varsr r"r#rDls

zTaskInclude.get_varscCsD|j�di�}|r<g|d<tj||jj||j|j|jd�}n|}|S)z{
        This method is used to create the parent block for the included tasks
        when ``apply`` is specified
        r
r)Zplayrrr$r%)	rr5rr)rEZ_playZ_roleZ_variable_managerZ_loader)rr9Zp_blockr"r"r#�build_parent_block�s�	zTaskInclude.build_parent_block)NNN)NNNNN)FF)r=�
__module__�__qualname__�__doc__r-ZBASEZ
OTHER_ARGS�unionr0r<r�staticmethodr)r&r:rCrDrF�
__classcell__r"r"r r#r
"s
	)Z
__future__rrrr8Z
__metaclass__Zansible.constantsZ	constantsr1Zansible.errorsrZansible.playbook.blockrZansible.playbook.taskrZansible.utils.displayrZansible.utils.sentinelr	�__all__r>r
r"r"r"r#�<module>s

Zerion Mini Shell 1.0