HEX
Server: Apache/2.4.65 (Debian)
System: Linux kubikelcreative 5.10.0-35-amd64 #1 SMP Debian 5.10.237-1 (2025-05-19) x86_64
User: www-data (33)
PHP: 8.4.13
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_bootcmd.cpython-39.pyc
a

��`�@s�dZddlZddlmZddlmZmZddlmZddl	m
Z
ddl	mZddl	mZeZ
d	gZd
dded
�eed�gedddddddid�ddigidddgd�id�	Zee�Zdd�ZdS)z:Bootcmd: run arbitrary commands early in the boot process.�N)�dedent)�get_schema_doc�validate_cloudconfig_schema)�
PER_ALWAYS)�
temp_utils)�subp)�util�allZ
cc_bootcmdZBootcmdz0Run arbitrary commands early in the boot processa�        This module runs arbitrary commands very early in the boot process,
        only slightly after a boothook would run. This is very similar to a
        boothook, but more user friendly. The environment variable
        ``INSTANCE_ID`` will be set to the current instance id for all run
        commands. Commands can be specified either as lists or strings. For
        invocation details, see ``runcmd``.

        .. note::
            bootcmd should only be used for things that could not be done later
            in the boot process.

        .. note::

          when writing files, do not use /tmp dir as it races with
          systemd-tmpfiles-clean LP: #1707222. Use /run/somedir instead.
    z�        bootcmd:
            - echo 192.168.1.130 us.archive.ubuntu.com > /etc/hosts
            - [ cloud-init-per, once, mymkfs, mkfs, /dev/vdb ]
    �object�bootcmd�array�oneOf�type�string)r�itemsF�)rrZadditionalItemsZadditionalPropertiesZminItems�required)	�id�name�title�description�distrosZexamples�	frequencyrZ
propertiescCsd|vr|�d|�dSt|t�tjdd���}z*t�|d�}|�t�|��|�	�Wn8t
y�}z t�|dt|���WYd}~n
d}~00z@t
j��}|��}	|	r�t|	�|d<d|jg}
tj|
|dd	�Wn"t
y�t�|d
|��Yn0Wd�n1�s0YdS)Nrz;Skipping module named %s, no 'bootcmd' key in configurationz.sh)�suffixzFailed to shellify bootcmd: %s�INSTANCE_IDz/bin/shF)�env�capturezFailed to run bootcmd module %s)�debugr�schemar�ExtendedTemporaryFiler�shellify�write�encode_text�flush�	Exception�logexc�str�os�environ�copy�get_instance_idrr)r�cfg�cloud�log�_argsZtmpf�content�er�iid�cmd�r3�=/usr/lib/python3/dist-packages/cloudinit/config/cc_bootcmd.py�handlePs0�


r5)�__doc__r'�textwraprZcloudinit.config.schemarr�cloudinit.settingsr�	cloudinitrrrrrrr5r3r3r3r4�<module>
sB�����-