Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/render.cpython-310.pyc
o

}��f��@s�dZddlZddlZddlZddlZddlmZddlmZm	Z	m
Z
mZdZe�j
Ze�e�Zddd�Zdd	d
�Zdd�Zed
krNe�eee�����dSdS)z,Debug jinja template rendering of user-data.�N)�read_cfg_paths)�JinjaLoadError�JinjaSyntaxParsingException�
NotJinjaError�render_jinja_payload_from_file�rendercCsR|s	tjttd�}|jdtdd�|jddtdt��d�|jdd	d
ddd
�|S)aBuild or extend and arg parser for jinja render utility.

    @param parser: Optional existing ArgumentParser instance representing the
        subcommand which will be extended to support the args of this utility.

    @returns: ArgumentParser with proper argument configuration.
    )�prog�description�	user_dataz$Path to the user-data file to render)�type�helpz-iz--instance-dataz6Optional path to instance-data.json file. Defaults to z-dz--debug�
store_trueFz+Add verbose messages during template render)�action�defaultr)�argparse�ArgumentParser�NAME�__doc__�add_argument�str�CLOUDINIT_RUN_DIR)�parser�r�</usr/lib/python3/dist-packages/cloudinit/cmd/devel/render.py�
get_parsers*���	�rFc
Cs||r|}n't�}t��}|�d�}|dkr*|�d�}tj�|�s)t�d||�|}n|}tj�|�s:t�d|�dSzt	|��}|�
�}Wd�n1sNwYWntydt�d|�YdSwzt||||rnd	nd
d�}	Wn8t
tfy�}
zt�dt|
��WYd}
~
dSd}
~
wty�}
zt�d
|t|
��WYd}
~
dSd}
~
ww|	s�t�d|�dStj�|	�dS)z�Render the provided user-data template file using instance-data values.

    Also setup CLI log handlers to report to stderr since this is a development
    utility which should be run by a human on the CLI.

    @return 0 on success, 1 on failure.
    �
instance_datar�instance_data_sensitivez4Missing root-readable %s. Using redacted %s instead.z#Missing instance-data.json file: %s�NzMissing user-data file: %sTF)�payload�
payload_fn�instance_data_file�debugz5Cannot render from instance data due to exception: %sz2Failed to render templated user-data file '%s'. %sz#Unable to render user-data file: %s)r�os�getuid�get_runpath�path�exists�LOG�warning�error�open�read�IOErrorrrr�reprrr�sys�stdout�write)�user_data_path�instance_data_pathr!�instance_data_fn�paths�uid�redacted_data_fn�streamr
�rendered_payload�errr�render_template:sn

��

���

������r:cCst|j|j|j�S�N)r:r
rr!)�_name�argsrrr�handle_argsvsr>�__main__r;)NF)rr�loggingr"r.�cloudinit.cmd.develr�!cloudinit.handlers.jinja_templaterrrrr�run_dirr�	getLogger�__name__r'rr:r>�exit�
parse_argsrrrr�<module>s 


 <�

Spamworldpro Mini