PageRenderTime 20ms CodeModel.GetById 11ms app.highlight 6ms RepoModel.GetById 1ms app.codeStats 0ms

/src/clj/backtype/storm/deploy_util.clj

http://github.com/nathanmarz/storm-deploy
Clojure | 17 lines | 14 code | 3 blank | 0 comment | 0 complexity | c79998d1d05a13be92b3b9943766f20b MD5 | raw file
 1(ns backtype.storm.deploy-util
 2  (:require [clojure.string :as s]
 3            [pallet.execute :as execute]))
 4
 5(def env-keys-to-resolve [:username :public-key-path :private-key-path])
 6
 7(defn resolve-path [path]
 8  (s/trim (:out (execute/local-script (echo ~path)))))
 9
10(defn resolve-keypaths
11  [user-map]
12  (reduce #(%2 %1)
13          user-map
14          (for [kwd env-keys-to-resolve]
15            #(if (kwd %)
16               (update-in % [kwd] resolve-path)
17               %))))