From 82b6bbd03ad5c37be251c3530e09cce802e322af Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 10 Mar 2019 19:39:39 +0100 Subject: [PATCH] System->Diagnostics->Activity, python 3 conversion --- src/opnsense/scripts/systemhealth/activity.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/opnsense/scripts/systemhealth/activity.py b/src/opnsense/scripts/systemhealth/activity.py index 2366deb06..8b3046667 100755 --- a/src/opnsense/scripts/systemhealth/activity.py +++ b/src/opnsense/scripts/systemhealth/activity.py @@ -1,7 +1,7 @@ -#!/usr/local/bin/python2.7 +#!/usr/local/bin/python3.6 """ - Copyright (c) 2015 Ad Schellevis + Copyright (c) 2015-2019 Ad Schellevis All rights reserved. Redistribution and use in source and binary forms, with or without @@ -43,7 +43,8 @@ if __name__ == '__main__': subprocess.call(['/usr/bin/top','-aHSn','999999'], stdout=output_stream, stderr=open(os.devnull, 'wb')) output_stream.seek(0) is_header = True - for line in output_stream.read().strip().split('\n'): + lines = output_stream.read().decode().strip().split('\n') + for line in lines: # end of header, start of top detection if line.find('USERNAME') > -1 and line.find('COMMAND') > -1: is_header = False