add live_users key

master
nathaniel smith 2015-07-26 00:01:25 -07:00
parent f142b3fd0c
commit b74155de3e
1 changed files with 10 additions and 7 deletions

View File

@ -46,13 +46,16 @@
(filter (fn [f] (and (not (= f "ubuntu")) (not (= f "poetry")))))))
(if (= __name__ "__main__")
(let [[users (->> (user-generator)
(let [[all_users (->> (user-generator)
sort-user-list
reversed
(map (fn [un] {"username" un
"default" (default? un)}))
list)]
[data {"users" users
list)
[live_users (-> (filter (fn [u] (not (get u "default"))) all_users)
list)]]
[data {"all_users" users
"live_users" live_users
"active_user_count" (-> (. (facter "active_user_count") stdout)
.strip
int)