From ae2a7be09d2fb0765a86a9e5fa601ae23a0feb17 Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 18 Jan 2019 18:53:49 -0500 Subject: [PATCH] bugfix --- sys/user_cull.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/user_cull.py b/sys/user_cull.py index 50986cd..464e7fd 100755 --- a/sys/user_cull.py +++ b/sys/user_cull.py @@ -87,7 +87,10 @@ def get_idle(user): for user in psutil.users(): if user.name in exclude_users: continue - login_pid = user.pid + try: + login_pid = user.pid + except AttributeError: + continue # Doesn't have a PID login_length = (datetime.datetime.utcnow() - datetime.datetime.fromtimestamp(user.started)) if login_length.total_seconds() < timeout: continue # they haven't even been logged in for long enough yet.