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"))))))) (filter (fn [f] (and (not (= f "ubuntu")) (not (= f "poetry")))))))
(if (= __name__ "__main__") (if (= __name__ "__main__")
(let [[users (->> (user-generator) (let [[all_users (->> (user-generator)
sort-user-list sort-user-list
reversed reversed
(map (fn [un] {"username" un (map (fn [un] {"username" un
"default" (default? un)})) "default" (default? un)}))
list)] list)
[data {"users" users [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) "active_user_count" (-> (. (facter "active_user_count") stdout)
.strip .strip
int) int)