File: //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_bootcmd.cpython-39.pyc
a
��` � @ s� d Z ddlZddlmZ ddlmZmZ ddlmZ ddl m
Z
ddl mZ ddl mZ eZ
d gZd
dded
�eed�gedddddddid�ddigidddg d�id� Zee�Z dd� 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� )r r ZadditionalItemsZadditionalPropertiesZminItems�required) �id�name�title�description�distrosZexamples� frequencyr Z
propertiesc C s d|vr|� d| � d S t|t� tjdd���}z*t�|d �}|�t�|�� |� � W n8 t
y� } z t�|dt|�� � W Y d }~n
d }~0 0 z@t
j�� }|�� } | r�t| �|d<