autotest: remove sensitive lines from error msg for further tko parsing.

The lines got from client side test may include phrase like 'END GOOD',
which will make tko parser parse the same test twice. This CL removes it
from raised error msg, so that it won't be recorded in status.log later.

TEST=Ran unittest

Change-Id: Ibefc27eddd3b7c1df12aac2f66a5dec57b03c5f9
Reviewed-by: Ningning Xia <>
Commit-Queue: Xixuan Wu <>
Tested-by: Xixuan Wu <>
diff --git a/server/ b/server/
index ba2ee6a..bd57ca8 100644
--- a/server/
+++ b/server/
@@ -939,8 +939,14 @@
                     # give the client machine a chance to recover from a crash
                * 3600)
+                    logging.debug('Unexpected final status message from '
+                                  'client %s: %s', (, last))
+                    # The line 'last' may have sensitive phrases, like
+                    # 'END GOOD', which breaks the tko parser. So the error
+                    # message will exclude it, since it will be recorded to
+                    # status.log.
                     msg = ("Aborting - unexpected final status message from "
-                           "client on %s: %s\n") % (, last)
+                           "client on %s\n") %
                     raise error.AutotestRunError(msg)
             logging.debug('Autotest job finishes running. Below is the '