From 84095360dd0401b97a7d04f522886f02ed05162d Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Tue, 26 Mar 2019 22:35:39 -0400 Subject: [PATCH 1/2] selfdrive: add sys module to exit call exit() is a helper for interactive shell. Let's explicit use the module sys. --- selfdrive/debug/dump.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/selfdrive/debug/dump.py b/selfdrive/debug/dump.py index 92b10cadcae0f8..45b737953fdebe 100755 --- a/selfdrive/debug/dump.py +++ b/selfdrive/debug/dump.py @@ -39,7 +39,7 @@ def run_server(socketio): port = int(m) else: print("service not found") - exit(-1) + sys.exit(-1) sock = messaging.sub_sock(context, port, poller, addr=args.addr) if args.proxy: republish_socks[sock] = messaging.pub_sock(context, port) From b7c4f0322eb02ca21da1dc16591006cef2b0d761 Mon Sep 17 00:00:00 2001 From: Douglas Schilling Landgraf Date: Tue, 26 Mar 2019 22:45:10 -0400 Subject: [PATCH 2/2] selfdrive: tomstoned.py use constant for /data/tombstones/ Instead of use multiple times a string for the data dir, use a variable. --- selfdrive/tombstoned.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/selfdrive/tombstoned.py b/selfdrive/tombstoned.py index bac43a0a19772a..c76294e6c56864 100644 --- a/selfdrive/tombstoned.py +++ b/selfdrive/tombstoned.py @@ -11,8 +11,9 @@ from selfdrive.swaglog import cloudlog def get_tombstones(): - return [("/data/tombstones/"+fn, int(os.stat("/data/tombstones/"+fn).st_ctime) ) - for fn in os.listdir("/data/tombstones") if fn.startswith("tombstone")] + DIR_DATA = "/data/tombstones/" + return [(DIR_DATA + fn, int(os.stat(DIR_DATA + fn).st_ctime) ) + for fn in os.listdir(DIR_DATA) if fn.startswith("tombstone")] def report_tombstone(fn, client): mtime = os.path.getmtime(fn)