Skip to content

Instantly share code, notes, and snippets.

@tbatchelli
Created October 20, 2011 20:02
Show Gist options
  • Save tbatchelli/1302174 to your computer and use it in GitHub Desktop.
Save tbatchelli/1302174 to your computer and use it in GitHub Desktop.
Getting settings for all nodes for all groups
(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