Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/netmiko/mellanox/__pycache__/mellanox_mlnxos_ssh.cpython-39.pyc
Ðазад
a v�h+ � @ s8 d Z ddlZddlmZ ddlmZ G dd� de�ZdS )� Mellanox MLNX-OS Switch support.� N)�CiscoSSHConnection)�logc sd e Zd ZdZddejfdd�Zd� fdd� Zd� fd d� Zd� fdd� Z ddd�Z ddd�Z� ZS )�MellanoxMlnxosSSHr �enable�#c C sB d}| � � s>| �| �|�� || j||d�7 }| � � s>td��|S )zEnter into enable mode.� )�pattern�re_flagszFailed to enter enable mode.)Zcheck_enable_mode� write_channel� normalize_cmdZread_until_prompt_or_pattern� ValueError)�self�cmdr r �output� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/netmiko/mellanox/mellanox_mlnxos_ssh.pyr s �zMellanoxMlnxosSSH.enable�config termc s t � j||d�S )N)�config_commandr )�super�config_mode)r r r �� __class__r r r s zMellanoxMlnxosSSH.config_mode�(configc s t � j||d�S )N)�check_stringr )r �check_config_mode)r r r r r r r s z#MellanoxMlnxosSSH.check_config_mode�no cli session paging enable� c s t � j||d�S )N)�command�delay_factor)r �disable_paging)r r r r r r r s z MellanoxMlnxosSSH.disable_paging�exitc C sj d}d}|dkrF| � � rF| �| �|�� || j|d�7 }nqF|d8 }q| � � rVtd��t�d|� �� |S )z�Mellanox does not support a single command to completely exit configuration mode. Consequently, need to keep checking and sending "exit". r � r )r r z!Failed to exit configuration modezexit_config_mode: )r r r Zread_until_patternr r �debug)r Zexit_configr r Zcheck_countr r r �exit_config_mode s z"MellanoxMlnxosSSH.exit_config_mode�configuration writeFr c C s2 | � � }|| �� 7 }|| �|�7 }|| �� 7 }|S )z=Save Config on Mellanox devices Enters and Leaves Config Mode)r r Zsend_commandr$ )r r ZconfirmZconfirm_responser r r r �save_config5 s zMellanoxMlnxosSSH.save_config)r r )r r )r r )r! r )r% Fr ) �__name__� __module__�__qualname__�__doc__�re� IGNORECASEr r r r r$ r&