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