3 \�mevK � @ s� d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dl m Z mZmZm Z d dlmZmZmZmZmZ d dlmZmZ dZeje�Zdd� Zdeed �d d�Zdd � Zddd�ZG dd� dej �Z ddd�Z!dS )� N)�Optional�cast)�features�safeyaml�subp�util)�IPV6_DYNAMIC_TYPES� SYS_CLASS_NET�get_devicelist�renderer�subnet_is_ipv6)�NET_CONFIG_TO_V2�NetworkStates4 # This is the initial network config. # It can be overwritten by cloud-init or console-conf. network: version: 2 ethernets: all-en: match: name: "en*" dhcp4: true all-eth: match: name: "eth*" dhcp4: true c s t � fdd�| j� D ��S )Nc 3 s$ | ]\}}|j � �r||fV qd S )N)� startswith)�.0�key�value)�match� �/usr/lib/python3.6/netplan.py� <genexpr>* s z,_get_params_dict_by_match.<locals>.<genexpr>)�dict�items)�configr r )r r �_get_params_dict_by_match( s r )r �entryc C sl d(dd�}|dkrg }g }g }g }g }| j dg �} | dkr>g } �x| D �]} | j d�}|jd�r�|dkrp|d7 }|j|d i� qF|tkr�|jd d i� qF|d)krFd | j d� }d| kr�|d| j d� 7 }| j d��rl| j d�dd�} yDtj| d �}tj|dd�}||k�r&tjd| d |� d | d<