File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/linux_ip.cpython-310.pyc
Back
o ;j � @ sz d Z ddlZddlZddlZddlZdZdd� Zddd�Zdd � Z d d� Z ddd �Zddd�Zdd� Z dd� Zdd� ZdS )z4 The networking module for Non-RH/Deb Linux distros � N�ipc C sf t jj�� rdS td dkrdS td dkrdS td dkr dS td d kr(d S t jj�d�s1dS tS ) z9 Confine this module to Non-RH/Deb Linux distros )Fz3Module linux_ip: Windows systems are not supported.Z os_familyZRedHat)Fz2Module linux_ip: RedHat systems are not supported.ZSuse)Fz0Module linux_ip: SUSE systems are not supported.ZDebian)Fz2Module linux_ip: Debian systems are not supported.Z NILinuxRT)Fz5Module linux_ip: NILinuxRT systems are not supported.r )FzQThe linux_ip execution module cannot be loaded: the ip binary is not in the path.)�salt�utils�platformZ is_windowsZ __grains__�path�which�__virtualname__� r r �I/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/linux_ip.py�__virtual__ s r c C � |dvrt d d| � d��S dS )zq Shutdown a network interface CLI Example: .. code-block:: bash salt '*' ip.down eth0 �Zslave�cmd.run�ip link set z downN��__salt__��ifaceZ iface_typer r r �down$ � r c C s t � }|�| �S )z� Return the contents of an interface script CLI Example: .. code-block:: bash salt '*' ip.get_interface eth0 )� _ip_ifaces�get)r Zifacesr r r � get_interface4 s r c C s� i } i }d}d}t d d�}|�� D ]�}|�d�sM|�d�}|d �� }|d �� �� }|�d��d ��d ��d�}t|�} |t t t| | ���d�||<