oop
This commit is contained in:
parent
94b326f1e5
commit
423c509878
@ -100,11 +100,12 @@ for user in psutil.users():
|
|||||||
continue # they haven't even been logged in for long enough yet.
|
continue # they haven't even been logged in for long enough yet.
|
||||||
idle_time = get_idle(user)
|
idle_time = get_idle(user)
|
||||||
if idle_time.total_seconds() >= timeout:
|
if idle_time.total_seconds() >= timeout:
|
||||||
fmtd_goodbye = goodbye_mesg.format({'pid': user.pid,
|
fmt_vals = {'pid': user.pid,
|
||||||
'terminal': user.terminal,
|
'terminal': user.terminal,
|
||||||
'loginlength': login_length,
|
'loginlength': login_length,
|
||||||
'logintime': datetime.datetime.fromtimestamp(user.started),
|
'logintime': datetime.datetime.fromtimestamp(user.started),
|
||||||
'timeout': timeout})
|
'timeout': timeout}
|
||||||
|
fmtd_goodbye = goodbye_mesg.format(**fmt_vals)
|
||||||
if only_ssh:
|
if only_ssh:
|
||||||
if user.pid in ssh_pids:
|
if user.pid in ssh_pids:
|
||||||
if goodbye:
|
if goodbye:
|
||||||
|
Loading…
Reference in New Issue
Block a user