Commit 6bc1c168 authored by Michael Hanselmann's avatar Michael Hanselmann

listrunner: Avoid exception if machine is rebooted

Handle exceptions gracefully when trying to read the command's output.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 7f4d4cf0
......@@ -323,7 +323,14 @@ def RunRemoteCommand(connection, command, logfile):
### Read when data is available
output = ""
while select.select([session], [], []):
data = session.recv(1024)
try:
data = session.recv(1024)
except socket.timeout, err:
data = None
WriteLog("FAILED: socket.timeout %s" % err, logfile)
except socket.error, err:
data = None
WriteLog("FAILED: socket.error %s" % err, logfile)
if not data:
break
output += data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment