Created
October 20, 2011 20:02
-
-
Save tbatchelli/1302174 to your computer and use it in GitHub Desktop.
Getting settings for all nodes for all groups
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn get-group-settings [session group] | |
(let [nodes (session/nodes-in-group session group)] | |
(zipmap (map #(compute/primary-ip %) nodes) | |
(map (fn [node] | |
(parameter/get-node-settings session node group nil)) | |
nodes)))) | |
(defn get-all-settings [session] | |
(let [groups (map :group-name (:groups session))] | |
(zipmap | |
groups | |
(map #(get-group-settings session %) groups)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment