From 6a70cca515e9f0175bee9e158fd9b5d199501b4d Mon Sep 17 00:00:00 2001 From: Raphael Roberts Date: Tue, 25 May 2021 17:22:06 -0500 Subject: [PATCH] Sort imports and add typing to exec_remote --- openwrt_backup/utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/openwrt_backup/utils.py b/openwrt_backup/utils.py index 5a227e8..0b6426b 100755 --- a/openwrt_backup/utils.py +++ b/openwrt_backup/utils.py @@ -1,6 +1,8 @@ -import paramiko from pathlib import Path from subprocess import list2cmdline +from typing import Union + +import paramiko def connection_from_config(name: str, ssh_config_root: Path): @@ -44,7 +46,7 @@ def connection_from_config(name: str, ssh_config_root: Path): return client -def exec_remote(connection: paramiko.SSHClient, command): +def exec_remote(connection: paramiko.SSHClient, command: Union[str, list]): """Function to execute specified command on conection""" if not isinstance(command, str): command = list2cmdline(command)