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

listrunner: Avoid exception if machine is rebooted

Handle exceptions gracefully when trying to read the command's output.
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 7f4d4cf0
......@@ -323,7 +323,14 @@ def RunRemoteCommand(connection, command, logfile):
### Read when data is available
output = ""
while[session], [], []):
data = session.recv(1024)
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:
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