      (cons v (chan->seq c terminate?)))))
 
 
-(def ^{:private true} paths {:zone  [:launch-specification :placement :availability-zone]
-                             :itype [:launch-specification :instance-type]
-                             :subnet [:launch-specification :instance-network-interface-specification 0 :subnet-id]
-                             :group [:launch-specification :network-interfaces 0 :groups 0]
-                             :public? [:launch-specification :network-interfaces 0 :associate-public-ip-address]
-                             :price [:spot-price]
-                             :n     [:instance-count]
-                             :udata [s->b64 :launch-specification :user-data]})
 
 
 (def my-ec2-info nil)

                       [:host [:public-dns-name #(when (seq %) %)]]])) ims)]
    (mseq->m xms :instance-id)))

(defn request-info-map [ids]
  (let [descs  (describe-spot-instance-requests :spot-instance-request-ids ids)
        sirs   (:spot-instance-requests descs)
        sirs   (map (fn [rm] (m-section rm [[:request-id :spot-instance-request-id] :state :instance-id])) sirs)



(def cred (read-string (slurp "AWS.clj")))
(apply defcredential (map cred [:access-key :secret-key :endpoint]))

(defn s->b64 [s] (String. (b64/encode (.getBytes s))))
(defn b64->s [s] (String. (b64/decode (.getBytes s))))
(defn- m->pair [[_ k v]] [(keyword k) v])
(defn b64->ec2-data
  "Given a base-64 encoded message of the form
     field1: some data
     field2: some other data
return a map of the form {:field1 \"some data\" :field2: \"some other data}."
  [s]
  (let [xs  (-> s b64->s clojure.string/split-lines)
        es  (map #(->> % 
                       (re-matches #"^([\w\-]+):\s*(.*)")
