Current File : //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_final_message.cpython-312.pyc
�

Ӈg
�
���UdZddlZddlmZmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZeZd
e
gegd�Zeed<ej*e�Zd
Zdede	dededdf
d�Zy)z@Final Message: Output final message when cloud-init has finished�N)�	templater�util�version)�Cloud)�Config)�
MetaSchema)�ALL_DISTROS)�log_util)�
PER_ALWAYS�cc_final_message)�id�distros�	frequency�activate_by_schema_keys�metazy## template: jinja
Cloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}.  Up {{uptime}} seconds�name�cfg�cloud�args�returnc
��d}t|�dk7rt|d�}ntj|dd�}|j	�}|st
}tj�}tj�}tj�}	|||t|j�d�}|jt|j�D�	�
cgc]\}	}
|	j�|
f��c}
}	��tj dt#j$||�zddt&��|j.j0}	|�d|�d|�d
�}
tj2||
d��|jj4dk(r@|jj6j9d�dgk7rt&j;d�yyycc}
}	w#t"j($r.}tj*t&d	t|��Yd}~��d}~wt,$rtj*t&d
�Y��wxYw#t,$rtj*t&d|�Y��wxYw)N�r�
final_message)�uptime�	timestampr�
datasourcez%s
FT)�console�stderr�logz,Failed to render templated final message: %sz'Failed to render final message templatez - z - v. �
)�ensure_dir_existsz%Failed to write boot finished file %s�None�datasource_listzUsed fallback datasource)�len�strr�get_cfg_option_str�strip�FINAL_MESSAGE_DEFr�time_rfc2822r�version_stringr�update�dict�items�upperr
�	multi_logr�
render_string�LOG�JinjaSyntaxParsingException�logexc�	Exception�paths�
boot_finished�
write_file�dsname�sys_cfg�get�warning)rrrr�msg_inr�ts�cver�subs�k�v�e�boot_fin_fn�contentss              �C/usr/lib/python3/dist-packages/cloudinit/config/cc_final_message.py�handlerF&s���
�F�
�4�y�A�~��T�!�W����(�(��o�r�B��
�\�\�^�F��"��
�[�[�]�F�	
�	�	�	�B��!�!�#�D�D�����e�.�.�/�	
��	
���D�T�Z�Z�\�B�T�Q��1�7�7�9�a�.�B�C�D�����i�-�-�f�d�;�<����		
��+�+�+�+�K�O�*0�"�d�;������X��G�
�����&�(����#�#�'�'�(9�:�v�h�F��K�K�2�3�G�)��+C���0�0�
�����?��Q��	
�	
���D����C�B�C�D���O����C�@�+�N�O�sC�=F?�	F9�%AF?�<#H'�9F?�?H$�$G;�;&H$�#H$�'$I�
I)�__doc__�logging�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.distrosr	�
cloudinit.logr
�cloudinit.settingsrrr�__annotations__�	getLogger�__name__r1r(r%�listrF��rE�<module>rVs���G��.�.�!�#�.�)�"�)��	�
��}��!�	��j���g����!��9��-4��-4�6�-4�%�-4�t�-4��-4rU