관리-도구
편집 파일: manager.cpython-39.opt-1.pyc
a �)g�b � @ sn d dl mZmZmZ eZd dlZd dlZd dlZd dl Zd dl Z d dlZd dlZd dl Z d dlmZ d dlmZmZ d dlmZ d dlmZmZ d dlmZmZmZ d dlmZ d d lmZ d d l m!Z! d dl"m#Z# d dl$m%Z% d d l&m'Z' d dl(m)Z)m*Z*m+Z+ edd�Z,edd�Z-ddiZ.dd� Z/d%dd�Z0d&dd�Z1dd� Z2dd� Z3d'dd �Z4d!d"� Z5G d#d$� d$e6�Z7dS )(� )�absolute_import�division�print_functionN)� namedtuple)�Mapping�Sequence)�NativeEnvironment)�AnsibleOptionsError�AnsibleError)�to_text�to_bytes� to_native)� yaml_load)�string_types)�boolean)�unquote)�AnsibleVaultEncryptedUnicode)� py3compat)�cleanup_tmp_file� makedirs_safe�unfrackpath�Pluginz name type�Settingzname value origin type�lookup)Z_termsc C s4 d}| r$|d| 7 }|r$|d| 7 }|d| 7 }|S )z& construct entry for requested config � zplugin_type: %s zplugin: %s zsetting: %s � )�plugin_type�plugin_name�config�entryr r �:/usr/lib/python3.9/site-packages/ansible/config/manager.py� _get_entry% s r! c s� d}d� |r,t j�|�r,t j�t|��r,|� |r8|�� }| du�r�|dv rZt| dd�} �n.|dv rnt| �} �n|dkr�t| �} �n|dkr�t | t �r�d d � | �d�D �} nt | t�s�d}�n�|dkr�| d kr�d} | dur�d }�n�|dk�rt | t ��rt | � d�} nd}�n||dv �rzt | t ��rrt | � d�} t j�| ��sFt| d� dt �� }tj|| d�} tjt| dd� nd}�n|dk�r�t | t ��r�| �t j�} t | t��r�� fdd �| D �} nd}n�|dk�rt | t ��r�dd � | �d�D �} t | t��r� fdd �| D �} nd}nv|dv �r.t | t��s�d}nZ|dv �rht | t tttttf��rbtt| dd ��} nd!}n t | t tf��r�tt| dd ��} |�r�td"|t| �f ��t| dd#d$�S )%a return a configuration variable with casting :arg value: The value to ensure correct typing of :kwarg value_type: The type of the value. This can be any of the following strings: :boolean: sets the value to a True or False value :bool: Same as 'boolean' :integer: Sets the value to an integer or raises a ValueType error :int: Same as 'integer' :float: Sets the value to a float or raises a ValueType error :list: Treats the value as a comma separated list. Split the value and return it as a python list. :none: Sets the value to None :path: Expands any environment variables and tilde's in the value. :tmppath: Create a unique temporary directory inside of the directory specified by value and return its path. :temppath: Same as 'tmppath' :tmp: Same as 'tmppath' :pathlist: Treat the value as a typical PATH string. (On POSIX, this means colon separated strings.) Split the value and then expand each part for environment variables and tildes. :pathspec: Treat the value as a PATH string. Expands any environment variables tildes's in the value. :str: Sets the value to string types. :string: Same as 'str' r N)r �boolF)�strict)Zinteger�int�float�listc S s g | ]}t |�� ��qS r )r �strip��.0�xr r r � <listcomp>_ � zensure_type.<locals>.<listcomp>�,Znone�None�path��basedir)�tmp�temppathZtmppathi� zansible-local-%s)�prefix�dirT)�warnr3 Zpathspecc s g | ]}t |� d ��qS �r0 ��resolve_pathr( r0 r r r+ � r, Zpathlistc S s g | ]}|� � �qS r )r'