added status code check
In the existing implementation when the ssh command fails the command result is silently discarded. It hides the fact that the disconnection did not go as expected. Effectively the intended action was not successful, but the play continues.
This commit is contained in:
parent
db08ff6dbd
commit
fe2eb2ae4a
1 changed files with 2 additions and 0 deletions
|
@ -897,6 +897,8 @@ class Connection(ConnectionBase):
|
|||
display.vvv(u'sending stop: %s' % cmd)
|
||||
p = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
stdout, stderr = p.communicate()
|
||||
status_code = p.wait()
|
||||
if status_code != 0:
|
||||
|
||||
self.close()
|
||||
|
||||
|
|
Loading…
Reference in a new issue