From 9be5b618809598ab62cf89f8fc297a25ce972569 Mon Sep 17 00:00:00 2001 From: nathaniel smith Date: Fri, 31 Jul 2015 21:44:46 -0700 Subject: [PATCH] replace facter since it required root --- tildetown-py/stats.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tildetown-py/stats.py b/tildetown-py/stats.py index c1f6ec5..c08e51d 100644 --- a/tildetown-py/stats.py +++ b/tildetown-py/stats.py @@ -21,7 +21,7 @@ def bounded_find(path): # find might return 1 but still have worked fine. return find(path, "-maxdepth", "3", _ok_code=[0,1]) -def active_user_count(): +def get_active_user_count(): return int(wc(sort(cut(who(), "-d", " ", "-f1"), "-u"), "-l")) def guarded_mtime(path): @@ -60,7 +60,7 @@ def get_user_data(): live_users = list(filter(live_p, all_users)) - active_user_count = int(facter("active_user_count").stdout.strip()) + active_user_count = get_active_user_count() return {'all_users': all_users, 'num_users': len(all_users),