HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_final_message.cpython-36.pyc
3

\�me�
�	@s�UdZddlZddlmZddlmZmZmZddlm	Z	ddl
mZddlm
Z
mZddlmZdd	lmZd
ZeZddd
eegeed�ggd�Ze
eje�Zee�ZdZeee	edd�dd�ZdS)z@Final Message: Output final message when cloud-init has finished�N)�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.
Zcc_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�descriptionZdistros�	frequencyZexamplesZactivate_by_schema_keyszy## template: jinja
Cloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}.  Up {{uptime}} seconds)r
�cfg�cloud�args�returncCs0d}t|�dkrt|d�}ntj|dd�}|j�}|s<t}tj�}tj�}tj	�}yR|||t|j
�d�}|jtdd�|j
�D���tjdtj||�dd	td
�Wn tk
r�tjtd�YnX|jj}	y"d|||f}
tj|	|
dd
�Wn$tk
�rtjtd|	�YnX|j
j�r,tjd�dS)N�rZ
final_message)�uptimeZ	timestampr�
datasourcecSsg|]\}}|j�|f�qS�)�upper)�.0�k�vrr�&/usr/lib/python3.6/cc_final_message.py�
<listcomp>\szhandle.<locals>.<listcomp>z%s
FT)Zconsole�stderr�logz'Failed to render final message templatez%s - %s - v. %s
)Zensure_dir_existsz%Failed to write boot finished file %szUsed fallback datasource)�len�strrZget_cfg_option_str�strip�FINAL_MESSAGE_DEFrZtime_rfc2822rZversion_stringr�update�dict�itemsZ	multi_logrZ
render_string�LOG�	ExceptionZlogexc�pathsZ
boot_finishedZ
write_fileZis_disconnectedZwarning)r
rrrZmsg_inrZtsZcverZsubsZboot_fin_fn�contentsrrr�handleFs>
r,)�__doc__Zlogging�textwraprZ	cloudinitrrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarr	Zcloudinit.distrosr
Zcloudinit.settingsrZMODULE_DESCRIPTIONr�metaZ	getLogger�__name__r(r$r"�listr,rrrr�<module>s.