[BUG] salt.client.ssh.shell.Shell.exec_cmd
can fail to report any exit status
#64588
Labels
salt.client.ssh.shell.Shell.exec_cmd
can fail to report any exit status
#64588
Description
In rare cases,
salt.client.ssh.shell.Shell.exec_cmd
queries the exit status of its VT before it is closed completely and its value was set, resulting in aNone
retcode. Also, ifos.WIFEXITED
is False (e.g. irregular exit because of a signal), it returns None as well.Setup
irrelevant
Steps to Reproduce the behavior
Run many salt-ssh integration tests with a patch that accounts and checks for
retcode is None
and find that retcode is seldomly (but reliably) reported asNone
(bysalt.client.ssh.Single.cmd_block
), even though the actual command returns the correct data:Expected behavior
Do not return None as an exit status. Return the actual exit status for regular exits, return a non-zero integer > 128 for irregular death by signal.
Versions Report
Present in current master.
Additional context
salt/salt/client/ssh/shell.py
Lines 467 to 469 in 2d02017
salt/salt/utils/vt.py
Lines 770 to 774 in 2d02017
This behavior is likely the cause of #64575 and became an issue because #64515 keeps track of the highest received retcode using
max
.The text was updated successfully, but these errors were encountered: