HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //lib/python3.6/site-packages/cloudinit/config/__pycache__/cc_ubuntu_autoinstall.cpython-36.pyc
3

\�me��	@s�UdZddlZddlZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlmZeje�Zd	gZd
dded
�eed�gedgd�Ze
e
e�ZdZeeeedd�dd�Zdd�ZdS)z;Autoinstall: Support ubuntu live-server autoinstall syntax.�N)�dedent)�Cloud)�Config)�
MetaSchema�
SchemaProblem�SchemaValidationError�get_meta_doc)�PER_ONCE)�subpZubuntuZcc_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 adherance 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�distrosZexamplesZ	frequencyZactivate_by_schema_keys�	subiquity�ubuntu-desktop-installer)r
�cfg�cloud�args�returncCs|d|krtjd|�dStddg�\}}d}xtD]}tj||�r2|}q2W|sdtjddjt��dSt|�tjd|�dS)Nrz?Skipping module named %s, no 'autoinstall' key in configurationZsnap�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
�LIVE_INSTALLER_SNAPS�re�searchZwarning�join�validate_config_schema)r
rrrZ	snap_list�_Zinstaller_presentZ	snap_name�r �+/usr/lib/python3.6/cc_ubuntu_autoinstall.py�handleMs&
r"cCs||d}t|t�s.ttddt|�j���g��d|krHttdd�g��n0t|jd�t�sxttddt|d�j���g��dS)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�dictrr�type�__name__�get�int)rZautoinstall_cfgr r r!ris
r)rr)�__doc__Zloggingr�textwraprZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrrrZcloudinit.settingsr	Zcloudinit.subpr
Z	getLoggerr'rr�metar�strrr"rr r r r!�<module>s0