File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/__pycache__/net.cpython-310.pyc
Back
o ;j{� � @ s d Z ddlZddlZzddlmZ ddlmZ ddl m Z dZW n ey+ dZY nw dZ d Zg ZdZd Zi ZdZdd � Zdd� Zdd� Zefdd�Zdd� Zdd� Zdd� Zddddddefdd�Zddddefdd�Zddddefdd�Zdddddefd d!�Zdefd"d#�Zd$d%� Z dS )&a; NET Finder ========== .. versionadded:: 2017.7.0 A runner to find network details easily and fast. It's smart enough to know what you are looking for. Configuration ------------- - Minion (proxy) config To have the complete features, one needs to add the following mine configuration in the minion (proxy) config file: .. code-block:: yaml mine_functions: net.ipaddrs: [] net.lldp: [] net.mac: [] net.arp: [] net.interfaces: [] Which instructs Salt to cache the data returned by the NAPALM-functions. While they are not mandatory, the less functions configured, the less details will be found by the runner. How often the mines are refreshed, can be specified using: .. code-block:: yaml mine_interval: <X minutes> - Master config By default the following options can be configured on the master. They are not necessary, but available in case the user has different requirements. target: ``*`` From what minions will collect the mine data. Default: ``*`` (collect from all minions). expr_form: ``glob`` Minion matching expression form. Default: ``glob``. ignore_interfaces A list of interfaces name to ignore. By default will consider all interfaces. display: ``True`` Display on the screen or return structured object? Default: ``True`` (return on the CLI). outputter: ``table`` Specify the outputter name when displaying on the CLI. Default: :mod:`table <salt.output.napalm_bgp>`. Configuration example: .. code-block:: yaml runners: net.find: target: 'edge*' expr_form: 'glob' ignore_interfaces: - lo0 - em1 - jsrv - fxp0 outputter: yaml � N)�helpers)� IPNetwork)�AddrFormatErrorTF�*�glob�table�netc C s t rtS dS )N)Fz'The napalm module could not be imported)� HAS_NAPALM�__virtualname__� r r �D/opt/saltstack/salt/lib/python3.10/site-packages/salt/runners/net.py�__virtual__q s r c C sL t �di ��di �} | �dt�| �dt�| �dt�| �dt�| �dt�d�S ) z- Return the net.find runner options. Zrunnersznet.find�target� expr_form�ignore_interfaces�display� outputter)r r r r r )�__opts__�get�_DEFAULT_TARGET�_DEFAULT_EXPR_FORM�_DEFAULT_IGNORE_INTF�_DEFAULT_DISPLAY�_DEFAULT_OUTPUTTER)Zrunner_optsr r r �_get_net_runner_optsw s �r c C sH | t v rt | rt | S t� }td |�d�| |�d�d�t | <