apache/libcloud — pull request #331 by oddshocks (2014-06-28 18:47:12+00:00)
Title: Add a delay to SSH connection to fix the deploy_node race condition

This patch might look a little "hackish", but it has solved the terrible `deploy_node` race condition for me 100%. I've been using libcloud with this patch for a few days with a 100% success rate. It seems that the `timeout` argument for `_ssh_client_connect` is insufficient. In fact, it's set to 300 seconds by default, but the entire operation doesn't take nearly that long to fail, so that timeout must not be the proper thing to fix the `deploy_node` race condition. *This* fix, however, resolves the issue. 60 seconds is more than enough time to get the SSH key installed onto the node, even with the recent addition of `ssh_alternate_usernames`, which we suspect to be the culprit of this new race condition.

Please, let me know if there's anything I can do to improve upon this patch and get it merged in. This is really a critical bug that needs to be resolved quickly.