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/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_final_message.cpython-311.pyc
�

܍~c�
����UdZddlmZddlmZddlmZmZmZddl	m
Z
ddlmZddl
mZmZddlmZdd	lmZd
ZeZddd
eegeed��ggd�Zeed<ee��ZdZdedede
dededdfd�ZdS)z@Final Message: Output final message when cloud-init has finished�)�Logger)�dedent)�	templater�util�version)�Cloud)�Config)�
MetaSchema�get_meta_doc)�ALL_DISTROS)�
PER_ALWAYSa�This module configures the final message that cloud-init writes. The message is
specified as a jinja template with the following variables set:

    - ``version``: cloud-init version
    - ``timestamp``: time at cloud-init finish
    - ``datasource``: cloud-init data source
    - ``uptime``: system uptime

This message is written to the cloud-init log (usually /var/log/cloud-init.log)
as well as stderr (which usually redirects to /var/log/cloud-init-output.log).

Upon exit, this module writes the system uptime, timestamp, and cloud-init
version to ``/var/lib/cloud/instance/boot-finished`` independent of any
user data specified for this module.
�cc_final_messagez
Final Messagez1Output final message when cloud-init has finishedz�            final_message: |
              cloud-init has finished
              version: $version
              timestamp: $timestamp
              datasource: $datasource
              uptime: $uptime
            )�id�name�title�description�distros�	frequency�examples�activate_by_schema_keys�metazy## template: jinja
Cloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}.  Up {{uptime}} secondsr�cfg�cloud�log�args�returnNc�~�d}t|��dkrt|d��}ntj|dd��}|���}|st
}tj��}tj��}tj	��}	|||t|j
��d�}	|	�td�|	�
��D������tjdtj||	��zdd|�	��n%#t"$rtj|d
��YnwxYw|jj}
	|�d|�d|�d
�}tj|
|d���n&#t"$rtj|d|
��YnwxYw|j
jr|�d��dSdS)N�r�
final_message)�uptime�	timestampr�
datasourcec�@�g|]\}}|���|f��S�)�upper)�.0�k�vs   �C/usr/lib/python3/dist-packages/cloudinit/config/cc_final_message.py�
<listcomp>zhandle.<locals>.<listcomp>]s(��B�B�B�T�Q��1�7�7�9�9�a�.�B�B�B�z%s
FT)�console�stderrrz'Failed to render final message templatez - z - v. �
)�ensure_dir_existsz%Failed to write boot finished file %szUsed fallback datasource)�len�strr�get_cfg_option_str�strip�FINAL_MESSAGE_DEFr �time_rfc2822r�version_stringr"�update�dict�items�	multi_logr�
render_string�	Exception�logexc�paths�
boot_finished�
write_file�is_disconnected�warning)rrrrr�msg_inr �ts�cver�subs�boot_fin_fn�contentss            r)�handlerIEs���F�
�4�y�y�A�~�~��T�!�W������(��o�r�B�B��
�\�\�^�^�F��#�"��
�[�]�]�F�	
�	�	�	�B��!�#�#�D�D�����e�.�/�/�	
�
��	
���D�B�B�T�Z�Z�\�\�B�B�B�C�C�D�D�D����i�-�f�d�;�;�<����		
�	
�	
�	
�	
���D�D�D���C�B�C�C�C�C�C�D�����+�+�K�O�*0�&�&�"�"�"�d�d�d�;�����X��G�G�G�G�G���O�O�O���C�@�+�N�N�N�N�N�O����
��'�0����.�/�/�/�/�/�0�0s%�BD�E�E�"E4�4 F�F)�__doc__�loggingr�textwrapr�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr	�cloudinit.config.schemar
r�cloudinit.distrosr�cloudinit.settingsr
�MODULE_DESCRIPTIONrr�__annotations__r4r1�listrIr$r+r)�<module>rVsz��G�F�F�������������.�.�.�.�.�.�.�.�.�.�!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�)�)�)�)�)�)�)�)�)�)�)�)��� 
�	�
��
@�%��}����
�		
�		
�� "�'���j����,�,�t�
�
��9��*0�

�*0��*0�#(�*0�/5�*0�=A�*0�	�*0�*0�*0�*0�*0�*0r+