Π·Π΅ΡΠΊΠ°Π»ΠΎ ΠΈΠ· https://github.com/microsoft/lisa.git
π Follow up to recent changes on to channel.recv_exit_status() lines
On e831ee037c
we have removed all traces
of initial buffering of stdout in that function. Let's see if this
middle ground, in which we advance the file pointer by one byte (and
thus pull in some cache/extra meat to be consumed on stdout), but only
one byte, is enough not to hang on those crazy, different scenarios.
This fixes pristine Windows boxes detection again.
This commit is contained in:
Π ΠΎΠ΄ΠΈΡΠ΅Π»Ρ
33a7cea454
ΠΠΎΠΌΠΌΠΈΡ
ea7bf7bb86
|
@ -154,8 +154,15 @@ def try_connect(connection_info: ConnectionInfo) -> Any:
|
|||
banner_timeout=10,
|
||||
)
|
||||
stdin, stdout, _ = paramiko_client.exec_command("cmd\n")
|
||||
# flush commands and prevent more writes
|
||||
# Flush commands and prevent more writes
|
||||
stdin.flush()
|
||||
|
||||
# Give it time to read/buffer something, otherwise reads on stdout
|
||||
# on calling contexts have been seen having empty strings from
|
||||
# stdout, on Windows. There is no moving back, but losing one byte
|
||||
# is not an issue for the function's intent
|
||||
_ = stdout.channel.recv(1)
|
||||
|
||||
stdin.channel.shutdown_write()
|
||||
paramiko_client.close()
|
||||
|
||||
|
|
ΠΠ°Π³ΡΡΠ·ΠΊΠ°β¦
Π‘ΡΡΠ»ΠΊΠ° Π² Π½ΠΎΠ²ΠΎΠΉ Π·Π°Π΄Π°ΡΠ΅