3 \�me+ � @ s� d dl Z d dlZd dlZd dlmZmZmZ d dlmZ ej e �ZeZ eZG dd� de jd�ZG dd� de�ZG d d � d e�ZG dd� de�ZdS ) � N)�net�subp�util)�ifconfigc @ s� e Zd ZdZed�dd�Zdd�edd�dd �Zej e dd �dd��Zed �dd�Z ed �dd�Ze ed �dd�Zdd� Zdd�ed�dd�Zed�dd�Zed�dd�Zeed�dd �Zed �d!d"�Zed�d#d$�Zed�d%d&�Zed �d'd(�Zdd)�eeed*�d+d,�Zeed-�d.d/�Zeed-�d0d1�Zej eed-�d2d3��Zeed-�d4d5�Zeed-�d6d7�Zeed-�d8d9�Z eed-�d:d;�Z!ej dd<�dd�d=d>��Z"d?d)�e edd@�dAdB�Z#ej eed-�dCdD��Z$dS )E� Networkinga The root of the Networking hierarchy in cloud-init. This is part of an ongoing refactor in the cloud-init codebase, for more details see "``cloudinit.net`` -> ``cloudinit.distros.networking`` Hierarchy" in CONTRIBUTING.rst for full details. )�returnc C s t j� S )N)r �_get_current_rename_info)�self� r � /usr/lib/python3.6/networking.pyr s z#Networking._get_current_rename_infoN)�current_info)�renamesr c C s t j||d�S )N)r )r �_rename_interfaces)r r r r r r r s zNetworking._rename_interfaces)�netcfgr c C s dS )z7Read the network config and rename devices accordingly.Nr )r r r r r �apply_network_config_names s z%Networking.apply_network_config_names)�devnamec C s t j|�S )N)r �device_devid)r r r r r r # s zNetworking.device_devidc C s t j|�S )N)r � device_driver)r r r r r r &