Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Lemur fixes.

- Fix spot-check-history.
- Further fix output of spot-check-history and display-types;
  cl-format doesn't flush *out*.
- Clean up shell_test. It was broken with JAVA_HOMEs like
  "/usr/lib/jvm/java-6-sun/jre".
  • Loading branch information...
commit d602eb36234d9c68fa42cc55be008c5036190e98 1 parent 99083bf
Jed Denlea authored
7 src/main/clj/com/climate/services/aws/ec2.clj
View
@@ -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)
6 src/main/clj/lemur/core.clj
View
@@ -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
19 src/test/clj/com/climate/shell_test.clj
View
@@ -39,14 +39,17 @@
: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 (let [java-home (get (System/getenv) "JAVA_HOME")]
+ (and
+ (not-empty 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"})))
+ (str "[" (pr-str java-home) " \"bar\"]"))))))
(deftest test-sh-with-files
(let [txt "some test text"
Please sign in to comment.
Something went wrong with that request. Please try again.