Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion spur/ssh.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ def __init__(self,
shell_type=None,
look_for_private_keys=True,
load_system_host_keys=True,
sock=None):
sock=None,
stdout=None,
stderr=None):

if connect_timeout is None:
connect_timeout = _ONE_MINUTE
Expand All @@ -149,6 +151,8 @@ def __init__(self,
self._load_system_host_keys = load_system_host_keys
self._closed = False
self._sock = sock
self._stdout = stdout
self._stderr = stderr

if missing_host_key is None:
self._missing_host_key = MissingHostKey.raise_error
Expand All @@ -173,7 +177,11 @@ def run(self, *args, **kwargs):

def spawn(self, command, *args, **kwargs):
stdout = kwargs.pop("stdout", None)
if stdout is None:
stdout = self._stdout
stderr = kwargs.pop("stderr", None)
if stderr is None:
stderr = self._stderr
allow_error = kwargs.pop("allow_error", False)
store_pid = kwargs.pop("store_pid", False)
use_pty = kwargs.pop("use_pty", False)
Expand Down