Server IP : 23.254.227.96 / Your IP : 216.73.216.46 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/lib/python3.6/site-packages/cloudinit/__pycache__/ |
Upload File : |
3 ��b< � @ s2 d dl Z d dlZd dlZyd dlmZ dZW n eefk rH dZY nX y d dl m Z d dl mZ dZ W n eefk r� dZ eZY nX d dlmZ d dlmZ d dlmZ d d lmZ eje�Zejd ej�Zejd�ZdZG d d� de�Zdd� Z dd� Z!dd� Z"ddd�Z#ddd�Z$dd� Z%dd� Z&dS ) � N)�TemplateTF)�DebugUndefined)�log)� type_utils)�util)� write_filez##\s*template:(.*)z)\$\{([A-Za-z0-9_.]+)\}|\$([A-Za-z0-9_.]+)zCI_MISSING_JINJA_VAR/c @ s e Zd ZdZdd� Zdd� ZdS )�UndefinedJinjaVariablez>Class used to represent any undefined jinja template variable.c C s dt | jf S )Nz%s%s)�MISSING_JINJA_PREFIX�_undefined_name)�self� r �/usr/lib/python3.6/templater.py�__str__/ s zUndefinedJinjaVariable.__str__c C s( t |�jtd�}tdj| j|d���d S )N� zhUndefined jinja variable: "{this}-{other}". Jinja tried subtraction. Perhaps you meant "{this}_{other}"?)�this�other)�str�replacer � TypeError�formatr )r r r r r �__sub__2 s zUndefinedJinjaVariable.__sub__N)�__name__� __module__�__qualname__�__doc__r r r r r r r , s r c s � fdd�}t j|| �S )z�This does simple replacement of bash variable like templates. It identifies patterns like ${a} or $a and can also identify patterns like ${a.b} or $a.b which will look for a key 'b' in the dictionary rooted by key 'a'. c s� | j d�}|d kr| j d�}|d kr,td��tj|jd��}� }xBt|�dkr�|j� }t|t�sxt d|t j|�|f ��|| }qBW |j� }t|t�s�t d||t j|�f ��t|| �S )N� � z,Match encountered but no valid group present�.zRCan not traverse into non-dictionary '%s' of type %s while looking for subkey '%s'z<Can not extract key '%s' from non-dictionary '%s' of type %s) �group�RuntimeError�collections�deque�split�len�popleft� isinstance�dictr �tuZobj_namer )�match�name�pathZselected_params�key)�paramsr r �replacerD s( zbasic_render.<locals>.replacer)� BASIC_MATCHER�sub)�contentr, r- r )r, r �basic_render<