forward3d/cap-ec2 — pull request #23 by tomconroy (2014-06-18 18:40:49+00:00)
Title: Add `instance_status_ok?` method to fix problem connecting to unavailable instances

If an instance's status isn't `ok` (as in the status checks—it could be `initializing`), `cap-ec2` still tries to deploy to it, but we get this error:

```
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host ec2-xx-xx-xx-xx.compute-1.amazonaws.com: Connection refused - connect(2) for "ec2-xx-xx-xx-xx.compute-1.amazonaws.com" port 22
```
And we're prevented from deploying (or running any tasks) on the other `ok` servers.

This patch adds a `instance_status_ok?` method that checks the status, and we can filter out the servers that aren't yet reachable.