관리-도구
편집 파일: __init__.cpython-39.pyc
a �)g�m � @ s. d dl mZmZmZ eZd dlZd dlmZm Z m Z mZ d dlm Z d dlmZmZmZ d dlmZ d dlmZmZ d dlmZ d d lmZ d d lmZ d dlmZ d dl m!Z! d d l"m#Z# d dl$m%Z% d dl&m'Z' d dl(m)Z) d dl*m+Z+ d dl,m-Z- d dl.m/Z/ ddgZ0dd� Z1G dd� deee%e�Z2dS )� )�absolute_import�division�print_functionN)� Container�Mapping�Set�Sequence)� constants)�AnsibleError�AnsibleParserError�AnsibleAssertionError)�to_text)�binary_type� text_type)�FieldAttribute)�Base)�CollectionSearch)�Conditional)�load_list_of_blocks)�RoleMetadata)�Taggable)�add_all_plugin_dirs)�AnsibleCollectionConfig)� is_subpath)�Sentinel)�combine_vars�Role�hash_paramsc C s� t | t�r�t | ttf�s�t | t�rzzt| �� �}W q� tyv t� }| �� D ]\}}|� |t |�f� qNt|�}Y q�0 n^t | ttf�r�zt| �}W q� ty� t� }| D ]}|� t |�� q�t|�}Y q�0 nt| �}|S t| f�S )a� Construct a data structure of parameters that is hashable. This requires changing any mutable data structures into immutable ones. We chose a frozenset because role parameters have to be unique. .. warning:: this does not handle unhashable scalars. Two things mitigate that limitation: 1) There shouldn't be any unhashable scalars specified in the yaml 2) Our only choice would be to return an error anyway. ) � isinstancer r r r � frozenset�items� TypeError�set�addr r r )�params� new_params�k�v� r( �B/usr/lib/python3.9/site-packages/ansible/playbook/role/__init__.pyr 3 s( c s e Zd Zedd�Zedd�Zd9� fdd� Zd d � Zd:dd�Ze d;d d��Z d<dd�Zdd� Zdd� Z dd� Zd=dd�Zdd� Zdd� Zdd� Zd>dd �Zd?d!d"�Zd@d#d$�ZdAd%d&�Zd'd(� Zd)d*� Zd+d,� ZdBd-d.�Zd/d0� ZdCd1d2�ZdD� fd3d4� ZdE� fd5d6� Zd7d8� Z� Z S )Fr �string)Zisa�boolNFTc s� d | _ d | _d | _t� | _d | _d | _|| _g | _g | _ g | _ g | _d | _t� | _ t� | _t� | _t� | _|| _|d u r|i }|| _|| _tt| ��� d S �N)� _role_name� _role_path�_role_collection�dict�_role_params�_loader� _metadata�_play�_parents� _dependencies�_task_blocks�_handler_blocks�_compiled_handler_blocks� _default_vars� _role_vars� _had_task_run� _completed�_should_validate�_from_files�from_include�superr �__init__)�self�play� from_filesr@ �validate�� __class__r( r) rB h s, z Role.__init__c C s | � � S r, )�get_name�rC r( r( r) �__repr__� s z Role.__repr__c C s&