Browse files

Filter for running nodes in compute/run-nodes for jclouds

In order to work around an issue 501 in jclouds, the return value of
org.jclouds.compute/run-nodes is now filtered for running nodes.  This should
prevent the occasional hang, where pallet would try to ssh into a terminated
node.
  • Loading branch information...
1 parent 5809e66 commit f274a726906b8d38cbec1a1532aa97696c6b6612 @hugoduncan hugoduncan committed Mar 8, 2011
Showing with 13 additions and 9 deletions.
  1. +13 −9 src/pallet/compute/jclouds.clj
View
22 src/pallet/compute/jclouds.clj
@@ -338,15 +338,19 @@
(run-nodes
[_ node-type node-count request init-script]
- (jclouds/run-nodes
- (name (node-type :tag))
- node-count
- (build-node-template
- compute
- (-> request :user :public-key-path)
- request
- init-script)
- compute))
+ (->>
+ (jclouds/run-nodes
+ (name (node-type :tag))
+ node-count
+ (build-node-template
+ compute
+ (-> request :user :public-key-path)
+ request
+ init-script)
+ compute)
+ ;; The following is a workaround for terminated nodes.
+ ;; See http://code.google.com/p/jclouds/issues/detail?id=501
+ (filter compute/running?)))
(reboot
[_ nodes]

0 comments on commit f274a72

Please sign in to comment.