Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/netmiko/__pycache__/scp_handler.cpython-39.pyc
Ðазад
a v�h�: � @ sP d Z ddlZddlZddlZddlZddlZG dd� de�ZG dd� de�ZdS )z� Netmiko SCP operations. Supports file get and file put operations. SCP requires a separate SSH connection for a control channel. Currently only supports Cisco IOS and Cisco ASA. � Nc @ sB e Zd ZdZddd�Zdd� Zdd � Zd d� Zdd � Zdd� Z dS )�SCPConnz� Establish a secure copy channel to the remote network device. Must close the SCP connection to get the file to write to the remote filesystem � $@Nc C s$ || _ || _|| _|| _| �� d S )N)�ssh_ctl_chan�socket_timeout�progress� progress4�establish_scp_conn)�self�ssh_connr r r � r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/netmiko/scp_handler.py�__init__ s zSCPConn.__init__c C sL | j �� }| j �� | _| jjf i |�� tj| j�� | j| j | j d�| _dS )z%Establish the secure copy connection.�r r r N)r Z_connect_params_dictZ_build_ssh_client�scp_conn�connect�scpZ SCPClientZ get_transportr r r � scp_client)r Zssh_connect_paramsr r r r s �zSCPConn.establish_scp_connc C s | j �||� dS )z1Put file using SCP (for backwards compatibility).N�r �put�r �source_file� dest_filer r r �scp_transfer_file, s zSCPConn.scp_transfer_filec C sR | j j}d|v sd|v r@z| j�||� W qN ty< Y qN0 n| j�||� dS )zGet file using SCP.� cisco_ios�cisco_xeN)r �device_typer �get�EOFError)r r r �platformr r r �scp_get_file0 s zSCPConn.scp_get_filec C s | j �||� dS )zPut file using SCP.Nr r r r r �scp_put_file; s zSCPConn.scp_put_filec C s | j �� dS )zClose the SCP connection.N�r �close�r r r r r"