Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/pyeapi/api/__pycache__/ipinterfaces.cpython-39.pyc
Ðазад
a b�h�% � @ sB d Z ddlZddlmZ e�dej�ZG dd� de�Zdd� ZdS ) a� Module for working the logical IP interfaces in EOS This module provides an API for configuring logical IP interfaces using EOS and eAPI. Parameters: name (string): The interface name the configuration is in reference to. The interface name is the full interface identifier address (string): The interface IP address in the form of address/len. mtu (integer): The interface MTU value. The MTU value accepts integers in the range of 68 to 65535 bytes � N)�EntityCollectionzno switchport$c @ sP e Zd Zdd� Zdd� Zdd� Zdd� Zd d � Zdd� Zddd�Z ddd�Z d S )�Ipinterfacesc C s^ | � d| �}|dd� dv r0t�|tj�s0dS t|d�}|�| �|�� |�| �|�� |S )a� Returns the specific IP interface properties The Ipinterface resource returns the following: * name (str): The name of the interface * address (str): The IP address of the interface in the form of A.B.C.D/E * mtu (int): The configured value for IP MTU. Args: name (string): The interface identifier to retrieve the configuration for Return: A Python dictionary object of key/value pairs that represents the current configuration of the node. If the specified interface does not exist then None is returned. �interface %sr � )ZEtZPoN)�name) Z get_block� SWITCHPORT_RE�search�re�M�dict�update�_parse_address� _parse_mtu)�selfr �config�resource� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/pyeapi/api/ipinterfaces.py�get: s � zIpinterfaces.getc C s( t �d|�}|r|�d�nd}t|d�S )a� Parses the config block and returns the ip address value The provided configuration block is scaned and the configured value for the IP address is returned as a dict object. If the IP address value is not configured, then None is returned for the value Args: config (str): The interface configuration block to parse Return: dict: A dict object intended to be merged into the resource dict zip address ([^\s]+)� N)�address)r r �groupr )r r �match�valuer r r r Y s zIpinterfaces._parse_addressc C s t �d|�}tt|�d��d�S )a� Parses the config block and returns the configured IP MTU value The provided configuration block is scanned and the configured value for the IP MTU is returned as a dict object. The IP MTU value is expected to always be present in the provided config block Args: config (str): The interface configuration block to parse Return: dict: A dict object intended to be merged into the resource dict z mtu (\d+)r )�mtu)r r r �intr )r r r r r r r j s zIpinterfaces._parse_mtuc C s@ t �dt j�}t� }|�| j�D ]}| �|�}|r |||<