From 423c509878534f8454e13628d89b73489948c7c3 Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 18 Jan 2019 14:45:46 -0500 Subject: [PATCH] oop --- sys/user_cull.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sys/user_cull.py b/sys/user_cull.py index 2786d88..afcd711 100755 --- a/sys/user_cull.py +++ b/sys/user_cull.py @@ -100,11 +100,12 @@ for user in psutil.users(): continue # they haven't even been logged in for long enough yet. idle_time = get_idle(user) if idle_time.total_seconds() >= timeout: - fmtd_goodbye = goodbye_mesg.format({'pid': user.pid, - 'terminal': user.terminal, - 'loginlength': login_length, - 'logintime': datetime.datetime.fromtimestamp(user.started), - 'timeout': timeout}) + fmt_vals = {'pid': user.pid, + 'terminal': user.terminal, + 'loginlength': login_length, + 'logintime': datetime.datetime.fromtimestamp(user.started), + 'timeout': timeout} + fmtd_goodbye = goodbye_mesg.format(**fmt_vals) if only_ssh: if user.pid in ssh_pids: if goodbye: