%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/config/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_ubuntu_autoinstall.cpython-312.pyc

�

���f'�
��UdZddlZddlZddlmZddlmZmZddlm	Z	ddl
mZddlm
Z
mZmZmZddlmZej&e�Zd	gZd
dded
�eed�gedgd�Ze
ed<ee�ZdZdedede	deddf
d�Zd�Zy)z;Autoinstall: Support ubuntu live-server autoinstall syntax.�N)�dedent)�subp�util)�Cloud)�Config)�
MetaSchema�
SchemaProblem�SchemaValidationError�get_meta_doc)�PER_ONCE�ubuntu�cc_ubuntu_autoinstallzUbuntu Autoinstallz)Support Ubuntu live-server install syntaxa&        Ubuntu's autoinstall YAML supports single-system automated installs
        in either the live-server install, via the ``subiquity`` snap, or the
        next generation desktop installer, via `ubuntu-desktop-install` snap.
        When "autoinstall" directives are provided in either
        ``#cloud-config`` user-data or ``/etc/cloud/cloud.cfg.d`` validate
        minimal autoinstall schema adherence and emit a warning if the
        live-installer is not present.

        The live-installer will use autoinstall directives to seed answers to
        configuration prompts during system install to allow for a
        "touchless" or non-interactive Ubuntu system install.

        For more details on Ubuntu's autoinstaller:
            https://ubuntu.com/server/docs/install/autoinstall
    a�            # Tell the live-server installer to provide dhcp6 network config
            # and LVM on a disk matching the serial number prefix CT
            autoinstall:
              version: 1
              network:
                version: 2
                ethernets:
                  enp0s31f6:
                    dhcp6: yes
              storage:
                layout:
                  name: lvm
                  match:
                    serial: CT*
        �autoinstall)�id�name�title�description�distros�examples�	frequency�activate_by_schema_keys�meta)�	subiquityzubuntu-desktop-installerr�cfg�cloud�args�returnc�~�d|vrtjd|�ytj|�t	jddg�\}}d}t
D]}t
j||�s�|}�|s*tjddjt
��yt|�tjd|�y)Nrz?Skipping module named %s, no 'autoinstall' key in configuration�snap�listzaSkipping autoinstall module. Expected one of the Ubuntu installer snap packages to be present: %sz, z8Valid autoinstall schema. Config will be processed by %s)�LOG�debugr�wait_for_snap_seededr�LIVE_INSTALLER_SNAPS�re�search�warning�join�validate_config_schema)rrrr�	snap_list�_�installer_present�	snap_names        �H/usr/lib/python3/dist-packages/cloudinit/config/cc_ubuntu_autoinstall.py�handler/Ms����C���	�	�M��	
�	����e�$��9�9�f�f�-�.�L�I�q���)�*�	�
�9�9�Y�	�*� )��*�����
9��I�I�*�+�	
�
	��3���I�I�B���c
�V�|d}t|t�s,ttddt	|�j
���g��d|vrttdd�g��t|j
d�t�s/ttddt	|d�j
���g��y)a>Supplemental runtime schema validation for autoinstall yaml.

    Schema validation issues currently result in a warning log currently which
    can be easily ignored because warnings do not bubble up to cloud-init
    status output.

    In the case of the live-installer, we want cloud-init to raise an error
    to set overall cloud-init status to 'error' so it is more discoverable
    in installer environments.

    # TODO(Drop this validation When cloud-init schema is strict and errors)

    :raise: SchemaValidationError if any known schema values are present.
    rzExpected dict type but found: �versionzMissing required 'version' keyzautoinstall.versionzExpected int type but found: N)�
isinstance�dictr
r	�type�__name__�get�int)r�autoinstall_cfgs  r.r)r)js����-�(�O��o�t�,�#��!���_�-�6�6�7�9��
�
�	
���'�#�
�=�*J�
K�L�
�	
���+�+�I�6��
<�#��)���_�Y�7�8�A�A�B�D��
�
�	
�=r0)�__doc__�loggingr%�textwrapr�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemarr	r
r�cloudinit.settingsr�	getLoggerr6r!rr�__annotations__r$�strr r/r)�r0r.�<module>rFs���B��	�� �!�#���(��g����!���*��"� �
8��	��$��
�	
��(� -��Y-��j�-�^�t�
��A�����6��%��t����:(
r0

Zerion Mini Shell 1.0