Browse files

Merge pull request #18 from jeddenlea/master

Misc fixes.
  • Loading branch information...
2 parents 99083bf + 147c4d0 commit d537c99c15ded2b682cf0dae6929af8eb6254132 @mlimotte mlimotte committed Mar 21, 2013
View
7 src/main/clj/com/climate/services/aws/ec2.clj
@@ -125,9 +125,10 @@
([hours]
(spot-price-history hours nil))
([hours type]
- (let [now (GregorianCalendar.)
- end (.getTime now)
- start (.getTime (.add now GregorianCalendar/HOUR_OF_DAY hours))
+ (let [[start end] (let [volatile-cal (GregorianCalendar.)
+ end (.getTime volatile-cal)]
+ (.add volatile-cal GregorianCalendar/HOUR_OF_DAY (- hours))
+ [(.getTime volatile-cal) end])
sort-by (partial sort-by #(.getTimestamp %))
req (doto (DescribeSpotPriceHistoryRequest.)
(.setStartTime start)
View
6 src/main/clj/lemur/core.clj
@@ -902,7 +902,8 @@ calls launch - take action (upload files, start cluster, etc)
(cl-format true "~{~12<~a~>~}~%~
~{~{~12<~a~>~}~%~}"
(take-nth 2 flds)
- details))
+ details)
+ (flush))
(quit))
(defn- spot-price-history
@@ -918,7 +919,8 @@ calls launch - take action (upload files, start cluster, etc)
(cl-format true "~{~12<~a~>~}~%~
~{~{~12<~a~>~}~%~}"
(take-nth 2 flds)
- details))
+ details)
+ (flush))
(quit))
(defmacro when-local-test
View
17 src/test/clj/com/climate/shell_test.clj
@@ -39,14 +39,15 @@
:env (merge-env {:FOO "bar"}))))))
(deftest test-merge-env-2
- (is (re-find
- #"\[\"[\.\/\w]+\" \"bar\"\]"
- (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
- "(vector
- (get (System/getenv) \"JAVA_HOME\")
- (get (System/getenv) \"FOO\"))"
- :err :pass
- :env (merge-env {:FOO "bar"}))))))
+ (is (when-let [java-home (get (System/getenv) "JAVA_HOME")]
+ (.startsWith
+ (:out (sh "java" "-cp" (clj-main-jar) "clojure.main" "-e"
+ "(vector
+ (get (System/getenv) \"JAVA_HOME\")
+ (get (System/getenv) \"FOO\"))"
+ :err :pass
+ :env (merge-env {:FOO "bar"})))
+ (pr-str (vector java-home "bar"))))))
(deftest test-sh-with-files
(let [txt "some test text"

0 comments on commit d537c99

Please sign in to comment.