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

Ӈg��
��UdZddlZddlmZmZddlmZddlmZddl	m
Z
ddlmZeje�Zdd	d
�Zdgd�ed
gd�Ze
ed<d�Zdededededdf
d�Zy)z"Resolv Conf: configure resolv.conf�N)�	templater�util)�Cloud)�Config)�
MetaSchema)�PER_INSTANCEzresolv.confzsystemd.resolved.conf)z/etc/resolv.confz/etc/systemd/resolved.conf�cc_resolv_conf)�alpine�
azurelinux�fedora�mariner�opensusez
opensuse-leapzopensuse-microoszopensuse-tumbleweed�photon�rhel�sle_hpcz	sle-micro�sles�	openeuler�manage_resolv_conf)�id�distros�	frequency�activate_by_schema_keys�metac�f�g}g}d|vrQ|dj�D];\}}t|t�s�|r|j|��+|j|��=||zD]}|d|=�
|j	d�si|d<||d<t
j
d|�tj|||�y)N�options�flagsz$Writing resolv.conf from template %s)	�items�
isinstance�bool�append�get�LOG�debugr�render_to_file)�template_fn�params�target_fnamer�false_flags�key�val�flags        �A/usr/lib/python3/dist-packages/cloudinit/config/cc_resolv_conf.py�generate_resolv_confr-1s����E��K��F���y�)�/�/�1�	,�H�C���#�t�$���L�L��%��&�&�s�+�	,���#�$���9��d�#�$��:�:�i� ���y���F�7�O��I�I�4�k�B�
���[�,��?��name�cfg�cloud�args�returnc��d|vrtjd|�ytj|dd�stjd|�yd|vrtj	d�y	|jt|jj�}t||d|jj�	�y#t$rtj	d�YywxYw)
a[
    Handler for resolv.conf

    @param name: The module name "resolv_conf" from cloud.cfg
    @param cfg: A nested dict containing the entire cloud config contents.
    @param cloud: The L{CloudInit} object in use.
    @param log: Pre-initialized Python logger object to use for logging.
    @param args: Any module arguments from cloud.cfg
    rzFSkipping module named %s, no 'manage_resolv_conf' key in configurationNFzGSkipping module named %s, 'manage_resolv_conf' present but set to False�resolv_confz3manage_resolv_conf True but no parameters provided!z0No template found, not rendering resolve configs)r%r&r')r"r#r�get_cfg_option_bool�warning�get_template_filename�RESOLVE_CONFIG_TEMPLATE_MAP�distro�resolve_conf_fn�KeyErrorr-)r/r0r1r2r%s     r,�handler=Hs����3�&��	�	�
<��	
�
	��#�#�C�)=�u�E��	�	�
=��	
�
	��C�����I�J����1�1�'����(D�(D�E�
�����=�!��\�\�1�1��
�������F�G���s�%,B7�7C�C)�__doc__�logging�	cloudinitrr�cloudinit.cloudr�cloudinit.configr�cloudinit.config.schemar�cloudinit.settingsr�	getLogger�__name__r"r9r�__annotations__r-�str�listr=�r.r,�<module>rKs���)��%�!�#�.�+��g����!��&�"9����� � 4�5�'��j��.@�.+��+�6�+�%�+�t�+��+r.