%PDF- %PDF-
Direktori : /lib/python3/dist-packages/cloudinit/net/__pycache__/ |
Current File : //lib/python3/dist-packages/cloudinit/net/__pycache__/renderer.cpython-312.pyc |
� �f� � �~ � d dl Z d dlZd dlmZ d dlmZ d dlmZ d� Zd� Z ed� Z G d� d e j � Zy) � N)�Optional)�NetworkState)�generate_udev_rulec � � � � fd�S )Nc � �� �| d k( S )N�type� )�iface� match_types ��8/usr/lib/python3/dist-packages/cloudinit/net/renderer.py�<lambda>z filter_by_type.<locals>.<lambda> s �� ��u�V�}�4� � r )r s `r �filter_by_typer s �� �4�4r c � � � � fd�S )Nc � �� �| v xr | � S �Nr )r � match_names �r r z filter_by_attr.<locals>.<lambda> s �� �*��-�C�%� �2C� r r )r s `r �filter_by_attrr s �� �D�Dr �physicalc �h � e Zd Zdd�Zedefd�� Zej d dede e ddfd�� Zy) �RendererNc � � y r r )�self�configs r �__init__zRenderer.__init__ s � �r � network_statec � � t j � }| j t � D ]N }d|v s�|j d� s�|j dd� }|j t |d |d |�� � �P |j � S )z2Given state, emit udev rules to map mac to ifname.�name�mac_address�driverN)r )�io�StringIO�iter_interfaces�filter_by_physical�get�writer �getvalue)r �contentr r s r �_render_persistent_netzRenderer._render_persistent_net s� � � �+�+�-��"�2�2�3E�F� �E����5�9�9�]�#;����8�T�2��� � �&��f� �u�]�';�F��� � ���!�!r � templates�returnc � � y)zRender network state.Nr )r r r* �targets r �render_network_statezRenderer.render_network_state0 s � r r )NN)�__name__� __module__�__qualname__r �staticmethodr r) �abc�abstractmethodr �dictr. r r r r r sd � � � �"�l� "� �"� ��� %)�� $�#�$� �D�>�$� �$� �$r r ) r3 r! �typingr �cloudinit.net.network_stater �cloudinit.net.udevr r r r$ �ABCr r r r �<module>r: s>