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.

BUG=chromium:713004
TEST=Ran unittest

Change-Id: Ibefc27eddd3b7c1df12aac2f66a5dec57b03c5f9
Reviewed-on: https://chromium-review.googlesource.com/482542
Reviewed-by: Ningning Xia <nxia@chromium.org>
Commit-Queue: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
diff --git a/server/autotest.py b/server/autotest.py
index ba2ee6a..bd57ca8 100644
--- a/server/autotest.py
+++ b/server/autotest.py
@@ -939,8 +939,14 @@
                     # give the client machine a chance to recover from a crash
                     self.host.wait_up(
                         self.host.HOURS_TO_WAIT_FOR_RECOVERY * 3600)
+                    logging.debug('Unexpected final status message from '
+                                  'client %s: %s', (self.host.name, 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") % (self.host.hostname, last)
+                           "client on %s\n") % self.host.hostname
                     raise error.AutotestRunError(msg)
         finally:
             logging.debug('Autotest job finishes running. Below is the '