0x1949 Team - FAZEMRX - MANAGER
Edit File: boot_hook.cpython-310.pyc
o ���f� � @ 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 s6 t j�| t� |�d�| _d | _|r|�� | _d S d S )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__c C sJ t �|�}tj�| j|�}t jt �|�| jd d�}t � ||� � d� |S )Nr )�prefixi� )r �clean_filename�os�path�joinr �strip_prefix_suffix�dos2unix�prefixes� write_file�lstrip)r �payload�filename�filepath�contentsr r r �_write_part s �zBootHookPartHandler._write_partc C s� |t jv rd S | �||�}z| jrdt| j�ini }t�d� tj|g|dd� W d S tjy< t � td|� Y d S tyL t � td|� Y d S w )N�INSTANCE_IDzExecuting boothookF)� update_env�capturez#Boothooks script %s execution errorz'Boothooks unknown error when running %s)r �CONTENT_SIGNALSr"