Current Dir: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/handlers/__pycache__/

[FILE] boot_hook.cpython-310.pyc [ edit | delete | rename ]
[FILE] cloud_config.cpython-310.pyc [ edit | delete | rename ]
[FILE] jinja_template.cpython-310.pyc [ edit | delete | rename ]
[FILE] shell_script.cpython-310.pyc [ edit | delete | rename ]
[FILE] shell_script_by_frequency.cpython-310.pyc [ edit | delete | rename ]
[FILE] __init__.cpython-310.pyc [ edit | delete | rename ]

Viewing: /snap/core22/2955/usr/lib/python3/dist-packages/cloudinit/handlers/__pycache__/boot_hook.cpython-310.pyc

o

��i��@sPddlZddlZddlmZmZmZddlmZe�e	�Z
Gdd�dej�ZdS)�N)�handlers�subp�util)�
PER_ALWAYSc@s*eZdZdgZdd�Zdd�Zdd�ZdS)	�BootHookPartHandlerz#cloud-boothookcKs6tj�|t�|�d�|_d|_|r|��|_dSdS)N�	boothooks)r�Handler�__init__r�	get_ipath�boothook_dir�instance_id�get_instance_id)�self�paths�
datasource�_kwargs�r�>/usr/lib/python3/dist-packages/cloudinit/handlers/boot_hook.pyr	s�zBootHookPartHandler.__init__cCsJt�|�}tj�|j|�}tjt�|�|jdd�}t�	||�
�d�|S)Nr)�prefixi�)r�clean_filename�os�path�joinr�strip_prefix_suffix�dos2unix�prefixes�
write_file�lstrip)r�payload�filename�filepath�contentsrrr�_write_part s
�zBootHookPartHandler._write_partcCs�|tjvrdS|�||�}z|jrdt|j�ini}t�d�tj|g|dd�WdStjy<t	�
td|�YdStyLt	�
td|�YdSw)N�INSTANCE_IDzExecuting boothookF)�
update_env�capturez#Boothooks script %s execution errorz'Boothooks unknown error when running %s)r�CONTENT_SIGNALSr"r�str�LOG�debugr�ProcessExecutionErrorr�logexc�	Exception)r�data�ctyperr�	frequencyr �envrrr�handle_part)s"
��

��zBootHookPartHandler.handle_partN)�__name__�
__module__�__qualname__rr	r"r1rrrrrs
	r)
�loggingr�	cloudinitrrr�cloudinit.settingsr�	getLoggerr2r(rrrrrr�<module>s


Upload File: