| Server IP : 23.254.227.96 / Your IP : 216.73.216.21 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3.6/site-packages/cloudinit/config/__pycache__/ |
Upload File : |
3
��bu � @ s8 d Z ddlmZmZmZ ddlmZ eZdZdd� Z dS )a%
Final Message
-------------
**Summary:** output final message when cloud-init has finished
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
**Internal name:** ``cc_final_message``
**Module frequency:** always
**Supported distros:** all
**Config keys**::
final_message: <message>
� )� templater�util�version)�
PER_ALWAYSzy## template: jinja
Cloud-init v. {{version}} finished at {{timestamp}}. Datasource {{datasource}}. Up {{uptime}} secondsc C s0 d}t |�dkrt|d �}ntj|dd�}|j� }|s<t}tj� }tj� }tj � }yR|||t|j
�d�} | jtdd� | j
� D ��� tjdtj|| � dd |d
� W n tk
r� tj|d� Y nX |jj}
y"d|||f }tj|
|dd
� W n$ tk
�r tj|d|
� Y nX |j
j�r,|jd� d S )N� r Z
final_message)�uptimeZ timestampr �
datasourcec S s g | ]\}}|j � |f�qS � )�upper)�.0�k�vr r �&/usr/lib/python3.6/cc_final_message.py�
<listcomp>E s zhandle.<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�strr Zget_cfg_option_str�strip�FINAL_MESSAGE_DEFr Ztime_rfc2822r Zversion_stringr �update�dict�itemsZ multi_logr Z
render_string� ExceptionZlogexc�pathsZ
boot_finishedZ
write_fileZis_disconnectedZwarning)�_nameZcfgZcloudr �argsZmsg_inr ZtsZcverZsubsZboot_fin_fn�contentsr r r �handle/ s>