404

[ Avaa Bypassed ]




Upload:

Command:

elspacio@18.117.192.109: ~ $
3

\�meQ�@sXUddlZddlZddlZddlZddlmZddlmZmZddl	m
Z
ddlmZm
Z
ddlmZddlmZddlmZmZmZdd	lmZmZeeydd
lmZddlmZWn"ek
r�eZej d�ZYnXej!e"�Z#Gd
d�de�Z$Gdd�de�Z%Gdd�de
j&�Z'ddd�Z(d dd�Z)e*ee*d�dd�Z+ddfdfdd�Z,dS)!�N)�EACCES)�Optional�Type)�handlers)�b64d�
json_dumps)�Paths)�
PER_ALWAYS)�MISSING_JINJA_PREFIX�detect_template�
render_string)�	load_file�	load_json)�UndefinedError)�operator_rez[-.]c@seZdZdS)�JinjaLoadErrorN)�__name__�
__module__�__qualname__�rr�$/usr/lib/python3.6/jinja_template.pyr!src@seZdZdS)�
NotJinjaErrorN)rrrrrrrr%src@s(eZdZdgZed�dd�Zdd�ZdS)�JinjaTemplatePartHandlerz## template: jinja)�pathscKsTtjj|tdd�||_i|_x0|jdg�D] }x|j�D]}||j|<q:Wq,WdS)N�)�version�sub_handlers)r�Handler�__init__r	rr�getZ
list_types)�selfrZ_kwargsZhandler�ctyperrrr-sz!JinjaTemplatePartHandler.__init__cCs�|tjkrdS|jjd�}t|||�}|s.dStj|�}	|jj|	�}
|
sZtj	d||	�dS|
j
dkrz|
j||||||�n|
j
dkr�|
j|||||�dS)NZinstance_data_sensitivezPIgnoring jinja template for %s. Could not find supported sub-handler for type %sr�)rZCONTENT_SIGNALSrZget_runpath�render_jinja_payload_from_fileZtype_from_starts_withrr�LOG�warningZhandler_version�handle_part)r �datar!�filename�payloadZ	frequencyZheadersZjinja_json_file�rendered_payload�subtypeZsub_handlerrrrr&5s*




z$JinjaTemplatePartHandler.handle_partN)rrr�prefixesrrr&rrrrr)srFcCs�t|�ddkrtd��i}d}tjj|�s8td|��ytt|��}WnPtk
r�}z4d}t	|t
tf�r~|jt
kr~d|}t|�|�WYdd}~XnXt||||�}|s�dS|S)aRRender a jinja template payload sourcing variables from jinja_vars_path.

    @param payload: String of jinja template content. Should begin with
        ## template: jinja
.
    @param payload_fn: String representing the filename from which the payload
        was read used in error reporting. Generally in part-handling this is
        'part-##'.
    @param instance_data_file: A path to a json file containing variables that
        will be used as jinja template variables.

    @return: A string of jinja-rendered content with the jinja header removed.
        Returns None on error.
    rZjinjazPayload is not a jinja templateNzFCannot render jinja template vars. Instance data not yet present at %sz"Loading Jinja instance data failedzGCannot render jinja template vars. No read permission on '%s'. Try sudo)rr�os�path�existsrrr
�	Exception�
isinstance�IOError�OSError�errnor�render_jinja_payload)r)�
payload_fnZinstance_data_file�debug�
instance_datar*�e�msgrrrr#Rs,
r#cCs�t||jdg�dd�}|r*tjdt|��yt||�}Wn6ttfk
rn}ztjd|t	|��dSd}~XnXdd�t
jdt|�D�}|r�tjd	|d
j
|��|S)Nzbase64-encoded-keysT)�decode_paths�include_key_aliaseszConverted jinja variables
%sz"Ignoring jinja template for %s: %scSsg|]}d|jtd��qS)z'%s'�)�replacer
)�.0�varrrr�
<listcomp>�sz(render_jinja_payload.<locals>.<listcomp>z%s[^\s]+z:Could not render jinja template variables in file '%s': %sz, )�convert_jinja_instance_datarr$r7rr�	TypeError�JUndefinedErrorr%�str�re�findallr
�join)r)r6r8r7Zinstance_jinja_varsr*r9�warningsrrrr5s*
r5)�	orig_name�returncCstjtd|�}||kr|SdS)a�Return a jinja variable alias, replacing any operators with underscores.

    Provide underscore-delimited key aliases to simplify dot-notation
    attribute references for keys which contain operators "." or "-".
    This provides for simpler short-hand jinja attribute notation
    allowing one to avoid quoting keys which contain operators.
    {{ ds.v1_0.config.user_network_config }} instead of
    {{ ds['v1.0'].config["user.network-config"] }}.

    :param orig_name: String representing a jinja variable name to scrub/alias.

    :return: A string with any jinja operators replaced if needed. Otherwise,
        none if no alias required.
    �_N)rF�subr)rJ�
alias_namerrr�get_jinja_variable_alias�srOr=�/cCs�i}dd�|D�}x�t|j��D]�\}}|r:dj|||�n|}||krNt|�}t|t�r�t|||||d�||<tjd|�r�x0||j�D]\}	}
t	j
|
�||	<q�Wn|||<|r t|�}|r t	j
||�||<q W|S)z�Process instance-data.json dict for use in jinja templates.

    Replace hyphens with underscores for jinja templates and decode any
    base64_encoded_keys.
    cSsg|]}|jdd��qS)�-rL)r>)r?r.rrrrA�sz/convert_jinja_instance_data.<locals>.<listcomp>z	{0}{1}{2})�sepr;r<zv\d+$)�sorted�items�formatrr1�dictrBrF�match�copy�deepcopyrO)r'�prefixrRr;r<�result�key�valueZkey_pathZsubkeyZsubvaluerNrrrrB�s,
rB)F)F)-rXZloggingr-rFr4rZtypingrrZ	cloudinitrZcloudinit.atomic_helperrrZcloudinit.helpersrZcloudinit.settingsr	Zcloudinit.templaterr
rrZcloudinit.utilr
rr0rDZjinja2.exceptionsrZjinja2.lexerr�ImportError�compileZ	getLoggerrr$rrrrr#r5rErOrBrrrr�<module>s6
*
,


Filemanager

Name Type Size Permission Actions
__init__.cpython-36.opt-1.pyc File 6.43 KB 0644
__init__.cpython-36.pyc File 6.43 KB 0644
boot_hook.cpython-36.opt-1.pyc File 1.74 KB 0644
boot_hook.cpython-36.pyc File 1.74 KB 0644
cloud_config.cpython-36.opt-1.pyc File 3.73 KB 0644
cloud_config.cpython-36.pyc File 3.73 KB 0644
jinja_template.cpython-36.opt-1.pyc File 6.19 KB 0644
jinja_template.cpython-36.pyc File 6.19 KB 0644
shell_script.cpython-36.opt-1.pyc File 1.03 KB 0644
shell_script.cpython-36.pyc File 1.03 KB 0644
shell_script_by_frequency.cpython-36.opt-1.pyc File 2.13 KB 0644
shell_script_by_frequency.cpython-36.pyc File 2.13 KB 0644