%PDF- %PDF-
Direktori : /lib/python3/dist-packages/cloudinit/handlers/__pycache__/ |
Current File : //lib/python3/dist-packages/cloudinit/handlers/__pycache__/boot_hook.cpython-312.pyc |
� �f� � � � d dl Z d dlZd dlmZmZmZ d dlmZ e j e � Z G d� dej � Zy)� N)�handlers�subp�util)� PER_ALWAYSc �$ � e Zd ZdgZd� Zd� Zd� Zy)�BootHookPartHandlerz#cloud-boothookc � � t j j | t � |j d� | _ d | _ |r|j � | _ y y )N� boothooks)r �Handler�__init__r � get_ipath�boothook_dir�instance_id�get_instance_id)�self�paths� datasource�_kwargss �>/usr/lib/python3/dist-packages/cloudinit/handlers/boot_hook.pyr zBootHookPartHandler.__init__ sJ � ����!�!�$� �3�!�O�O�K�8�������)�9�9�;�D�� � c �< � t j |� }t j j | j |� }t j t j |� | j d �� }t j ||j � d� |S )Nr )�prefixi� )r �clean_filename�os�path�joinr �strip_prefix_suffix�dos2unix�prefixes� write_file�lstrip)r �payload�filename�filepath�contentss r �_write_partzBootHookPartHandler._write_part sq � ��&�&�x�0���7�7�<�<�� 1� 1�8�<���+�+��M�M�'�"�4�=�=��+;� �� ����(�/�/�"3�U�;��r c � � |t j v ry | j ||� } | j rdt | j � ini }t j d� t j |g|d�� y # t j $ r t j t d|� Y y t $ r t j t d|� Y y w xY w)N�INSTANCE_IDzExecuting boothookF)� update_env�capturez#Boothooks script %s execution errorz'Boothooks unknown error when running %s)r �CONTENT_SIGNALSr&