Browse Source

Sort imports and add typing to exec_remote

master
Raphael Roberts 5 years ago
parent
commit
6a70cca515
  1. 6
      openwrt_backup/utils.py

6
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)

Loading…
Cancel
Save