factory: Use str(Exception) instead of Exception.message
`Exception.message` is remove in python3.
We should always use `str(Exception)` to get the reason.
BUG=chromium:999876
TEST=make test
TEST=make lint
Change-Id: I327cac3e0f20de3ed95c1679961087f6f1331b3d
Reviewed-on: https://chromium-review.googlesource.com/1890460
Tested-by: Yilin Yang <kerker@chromium.org>
Commit-Ready: ChromeOS CL Exonerator Bot <chromiumos-cl-exonerator@appspot.gserviceaccount.com>
Legacy-Commit-Queue: Commit Bot <commit-bot@chromium.org>
Reviewed-by: Cheng-Han Yang <chenghan@chromium.org>
diff --git a/py/tools/ghost.py b/py/tools/ghost.py
index 5989b57..9e2790c 100755
--- a/py/tools/ghost.py
+++ b/py/tools/ghost.py
@@ -1202,13 +1202,13 @@
# Don't show stack trace for RuntimeError, which we use in this file for
# plausible and expected errors (such as can't connect to server).
except RuntimeError as e:
- logging.info('%s, retrying in %ds', e.message, _RETRY_INTERVAL)
+ logging.info('%s, retrying in %ds', str(e), _RETRY_INTERVAL)
time.sleep(_RETRY_INTERVAL)
except Exception as e:
unused_x, unused_y, exc_traceback = sys.exc_info()
traceback.print_tb(exc_traceback)
logging.info('%s: %s, retrying in %ds',
- e.__class__.__name__, e.message, _RETRY_INTERVAL)
+ e.__class__.__name__, str(e), _RETRY_INTERVAL)
time.sleep(_RETRY_INTERVAL)
self.Reset()