Skip to content

Commit 3f42ac1

Browse files
ydirsonglehmann
authored andcommitted
ssh: mark all keyword arguments as keyword-only
We would never dare to use them otherwise, and type hints overloads will require to order them differently in some overloads. Signed-off-by: Yann Dirson <[email protected]>
1 parent 131db69 commit 3f42ac1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/commands.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ def _ssh(hostname_or_ip, cmd, check, simple_output, suppress_fingerprint_warning
145145
# The actual code is in _ssh().
146146
# This function is kept short for shorter pytest traces upon SSH failures, which are common,
147147
# as pytest prints the whole function definition that raised the SSHCommandFailed exception
148-
def ssh(hostname_or_ip, cmd, check=True, simple_output=True, suppress_fingerprint_warnings=True, background=False,
149-
target_os='linux', decode=True, options=[]) -> Union[SSHResult, str, bytes, subprocess.Popen]:
148+
def ssh(hostname_or_ip, cmd, *, check=True, simple_output=True, suppress_fingerprint_warnings=True,
149+
background=False, target_os='linux', decode=True, options=[]):
150150
result_or_exc = _ssh(hostname_or_ip, cmd, check, simple_output, suppress_fingerprint_warnings,
151151
background, target_os, decode, options)
152152
if isinstance(result_or_exc, SSHCommandFailed):

0 commit comments

Comments
 (0)