mirror of https://github.com/apache/jclouds.git
Merge pull request #42 from mattiasholmqvist/master
Added in-group? predicate to compute2.clj
This commit is contained in:
commit
a3a97d02b8
|
@ -278,6 +278,11 @@ Here's an example of creating and running a small linux node in the group webser
|
||||||
[#^NodeMetadata node]
|
[#^NodeMetadata node]
|
||||||
(state-predicate node UNRECOGNIZED))
|
(state-predicate node UNRECOGNIZED))
|
||||||
|
|
||||||
|
(defn in-group?
|
||||||
|
"Returns a predicate fn which returns true if the node is in the given group, false otherwise"
|
||||||
|
[group]
|
||||||
|
#(= (.getGroup %) group))
|
||||||
|
|
||||||
(defn public-ips
|
(defn public-ips
|
||||||
"Returns the node's public ips"
|
"Returns the node's public ips"
|
||||||
[#^NodeMetadata node]
|
[#^NodeMetadata node]
|
||||||
|
|
|
@ -63,8 +63,6 @@ list, Alan Dipert and MeikelBrandmeyer."
|
||||||
(is (compute-service? *compute*))
|
(is (compute-service? *compute*))
|
||||||
(is (compute-service? (compute-service (compute-context *compute*)))))
|
(is (compute-service? (compute-service (compute-context *compute*)))))
|
||||||
|
|
||||||
(defn in-group? [group] #(= (.getGroup %) group))
|
|
||||||
|
|
||||||
(deftest nodes-test
|
(deftest nodes-test
|
||||||
(is (create-node *compute* "fred" (build-template *compute* {} )))
|
(is (create-node *compute* "fred" (build-template *compute* {} )))
|
||||||
(is (= 1 (count (nodes-in-group *compute* "fred"))))
|
(is (= 1 (count (nodes-in-group *compute* "fred"))))
|
||||||
|
|
Loading…
Reference in New Issue