0x1949 Team - FAZEMRX - MANAGER
Edit File: renderer.cpython-310.pyc
o ���f� � @ sb d dl Z d dlZd dlmZ d dlmZ d dlmZ dd� Zdd� Z ed �Z G d d� de j�ZdS )� N)�Optional)�NetworkState)�generate_udev_rulec � � fdd�S )Nc s � | d kS )N�type� ��iface�� match_typer �8/usr/lib/python3/dist-packages/cloudinit/net/renderer.py�<lambda> s z filter_by_type.<locals>.<lambda>r r r r r �filter_by_type � r c r )Nc s � | v o| � S �Nr r �� match_namer r r s z filter_by_attr.<locals>.<lambda>r r r r r �filter_by_attr r r �physicalc @ sN e Zd Zddd�Zedefdd��Zej ddede e ddfd d ��ZdS ) �RendererNc C s d S r r )�self�configr r r �__init__ s zRenderer.__init__� network_statec C sZ t �� }| �t�D ]}d|v r(|�d�r(|�dd�}|�t|d |d |d�� q |�� 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 r r r �_render_persistent_net s ���zRenderer._render_persistent_net� templates�returnc C s dS )zRender network state.Nr )r r r&