Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/netmiko/cdot/__pycache__/cdot_cros_ssh.cpython-39.pyc
Ðазад
a v�h( � @ s( d dl mZ d dlZG dd� de�ZdS )� )�CiscoBaseConnectionNc sp e Zd ZdZdd� Zd� fdd� Zd� fd d� Zd� fdd� Zddd�Zdd� Z dd� Z dd� Zdd� Z� Z S ) �CdotCrosSSHz<Implement methods for interacting with CROS network devices.c C sL | � � | �� | �� | jdd� | jdd� t�d| j � | �� dS )z>Prepare the session after the connection has been established.zscreen-length 0)�commandzscreen-width 511g333333�?N) Z_test_channel_readZset_base_prompt�_disable_complete_on_spaceZdisable_pagingZset_terminal_width�time�sleepZglobal_delay_factorZclear_buffer)�self� r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/netmiko/cdot/cdot_cros_ssh.py�session_preparation s zCdotCrosSSH.session_preparationNFc s t � jf ||d�|��S )z3CROS requires you not exit from configuration mode.)�config_commands�exit_config_mode)�super�send_config_set)r r r �kwargs�� __class__r r r s ��zCdotCrosSSH.send_config_set�)#�[#\$]c s t � j||d�S )z)Checks if device is in configuration mode)�check_string�pattern)r �check_config_mode)r r r r r r r ! s zCdotCrosSSH.check_config_mode�config� c s t � j||d�S )zEnter configuration mode.)�config_commandr )r �config_mode)r r r r r r r % s zCdotCrosSSH.config_mode� Tc s� | � |�}d}ddg}|r:d|v r*td��|d|� d�7 }| �� � � | j|dd|d �7 � t� fd d�|D ��s|td� � ���|r�| �� � S ) a Commit the candidate configuration. Commit the entered configuration. Raise an error and return the failure if the commit fails. default: command_string = commit comment: command_string = commit comment <comment> �commitzCommit completezNo modifications to commit�"z%Invalid comment contains double quotez comment "FT)Zstrip_promptZ strip_command�delay_factorc 3 s | ]}|� v V qd S )Nr )�.0�x��outputr r � <genexpr>I � z%CdotCrosSSH.commit.<locals>.<genexpr>z*Commit failed with the following errors: )�select_delay_factor� ValueErrorr Zsend_command�anyr )r �commentr Zand_quitZcommand_stringZ commit_markerr r"