From fb4776cd591ee0d8d9ec6144f34f84f1f3f1a0ae Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Tue, 25 May 2021 17:23:27 -0500 Subject: [PATCH] Replace connection with client --- openwrt_backup/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/openwrt_backup/utils.py b/openwrt_backup/utils.py index 0b6426b..ace94d7 100755 --- a/openwrt_backup/utils.py +++ b/openwrt_backup/utils.py @@ -5,8 +5,8 @@ from typing import Union import paramiko -def connection_from_config(name: str, ssh_config_root: Path): - """Create a connection from a Host entry in the .ssh/config file""" +def client_from_config(name: str, ssh_config_root: Path): + """Create a client from a Host entry in the .ssh/config file""" config = paramiko.config.SSHConfig() cp = ssh_config_root / "config" with open(cp) as file: @@ -46,9 +46,9 @@ def connection_from_config(name: str, ssh_config_root: Path): return client -def exec_remote(connection: paramiko.SSHClient, command: Union[str, list]): +def exec_remote(client: paramiko.SSHClient, command: Union[str, list]): """Function to execute specified command on conection""" if not isinstance(command, str): command = list2cmdline(command) - stdin, stdout, stderr = connection.exec_command(command) + stdin, stdout, stderr = client.exec_command(command) return stdout, stderr