Current File : //usr/lib/python3/dist-packages/cloudinit/config/__pycache__/cc_ubuntu_autoinstall.cpython-312.pyc
�

Ӈg��
���UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
ddlmZej e�Zdd	ged
gd�Zeed<d
Zdede	dededdf
d�Zd�Zy)z;Autoinstall: Support ubuntu live-server autoinstall syntax.�N)�subp�util)�Cloud)�Config)�
MetaSchema�
SchemaProblem�SchemaValidationError)�PER_ONCE�cc_ubuntu_autoinstall�ubuntu�autoinstall)�id�distros�	frequency�activate_by_schema_keys�meta)�	subiquityzubuntu-desktop-installer�name�cfg�cloud�args�returnc�~�d|vrtjd|�ytj|�t	jddg�\}}d}t
D]}t
j||�s�|}�|s*tjddjt
��yt|�tjd|�y)Nr
z?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*s����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.
    r
zExpected 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$<s����-�(�O��o�t�,�#��!���_�-�6�6�7�9��
�
�	
���'�#�
�=�*J�
K�L�
�	
���+�+�I�6��
<�#��)���_�Y�7�8�A�A�B�D��
�
�	
�=r+)�__doc__�loggingr �	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemarrr	�cloudinit.settingsr
�	getLoggerr1rr�__annotations__r�strrr*r$�r+r)�<module>r@s���B��	� �!�#���
(��g����!��"��z�� -��	��j��A�����6��%��t����:(
r+