HEX
Server: Apache
System: Linux scp1.abinfocom.com 5.4.0-216-generic #236-Ubuntu SMP Fri Apr 11 19:53:21 UTC 2025 x86_64
User: confeduphaar (1010)
PHP: 8.1.33
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //lib/python3/dist-packages/cloudinit/config/__pycache__/cc_ubuntu_autoinstall.cpython-38.pyc
U

��0h��@s�UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZe�e�Zdd	ged
gd�Zeed<d
Zee	eedd�dd�Zdd�ZdS)z;Autoinstall: Support ubuntu live-server autoinstall syntax.�N)�subp�util)�Cloud)�Config)�
MetaSchema�
SchemaProblem�SchemaValidationError)�PER_ONCEZcc_ubuntu_autoinstallZubuntu�autoinstall)�idZdistrosZ	frequencyZactivate_by_schema_keys�meta)Z	subiquityzubuntu-desktop-installer)�name�cfg�cloud�args�returncCszd|krt�d|�dSt�ddg�\}}d}tD]}t�||�r2|}q2|sbt�dd�t��dSt|�t�d|�dS)Nr
z?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�H/usr/lib/python3/dist-packages/cloudinit/config/cc_ubuntu_autoinstall.py�handles,���rcCs||d}t|t�s.ttddt|�j���g��d|krHttdd�g��n0t|�d�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.
    r
zExpected dict type but found: �versionzMissing required 'version' keyzautoinstall.versionzExpected int type but found: N)�
isinstance�dictrr�type�__name__�get�int)rZautoinstall_cfgrrrr;s*
���

����r)�__doc__ZloggingrZ	cloudinitrrZcloudinit.cloudrZcloudinit.configrZcloudinit.config.schemarrrZcloudinit.settingsr	Z	getLoggerr"rr�__annotations__r�strrrrrrrr�<module>s 
�