HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux ns565604.ip-54-39-133.net 4.18.0-553.50.1.el8_10.x86_64 #1 SMP Tue Apr 15 08:09:22 EDT 2025 x86_64
User: greer489 (1034)
PHP: 8.3.19
Disabled: NONE
Upload Files
File: //usr/lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_bootcmd.cpython-36.pyc
3

\�mei�	@s�UdZddlZddlZddlmZddlmZmZmZddl	m
Z
ddlmZddl
mZmZddlmZeje�ZeZd	gZd
dded
�eed�gedgd�Zeee�Zeee
edd�dd�ZdS)z:Bootcmd: run arbitrary commands early in the boot process.�N)�dedent)�subp�
temp_utils�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�
PER_ALWAYS�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 ]
    �bootcmd)�id�name�title�description�distrosZexamples�	frequencyZactivate_by_schema_keys)r�cfg�cloud�args�returnc
 Cs�d|krtjd|�dStjdd���}y*tj|d�}|jtj|��|j�Wn6t	k
r�}ztj
tdt|���WYdd}~XnXy@tj
j�}|j�}|r�t|�|d<d|jg}	tj|	|dd	�Wn$t	k
r�tj
td
|��YnXWdQRXdS)Nrz;Skipping module named %s, no 'bootcmd' key in configurationz.sh)�suffixzFailed to shellify bootcmd: %sZINSTANCE_IDz/bin/shF)�envZcapturezFailed to run bootcmd module %s)�LOG�debugrZExtendedTemporaryFilerZshellify�writeZencode_text�flush�	ExceptionZlogexc�str�os�environ�copyZget_instance_idrr)
rrrrZtmpfZcontent�erZiid�cmd�r$� /usr/lib/python3.6/cc_bootcmd.py�handleDs,

r&)�__doc__Zloggingr�textwraprZ	cloudinitrrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarr	Zcloudinit.settingsr
Z	getLogger�__name__rrr�metar�listr&r$r$r$r%�<module>
s.