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