Skip to content
Snippets Groups Projects
Commit ba082711 authored by Lloyd Hilaiel's avatar Lloyd Hilaiel Committed by Austin King
Browse files

fix provisioning failure where DescribeInstance doesn't find an instance...

fix provisioning failure where DescribeInstance doesn't find an instance immediately after provisioning
parent 4b3c2c73
No related branches found
No related tags found
No related merge requests found
......@@ -84,6 +84,13 @@ exports.waitForInstance = function(id, cb) {
InstanceId: id
}, function(r) {
if (!r) return cb('no response from ec2');
// we're waiting and amazon might not have created the image yet! that's
// not an error, just an api timing quirk
var waiting = jsel.match('.Error .Code:val("InvalidInstanceID.NotFound")', r);
if (waiting.length) {
return setTimeout(function(){ exports.waitForInstance(id, cb); }, 1000);
}
if (!r.instanceStatusSet) return cb('malformed response from ec2' + JSON.stringify(r, null, 2));
if (Object.keys(r.instanceStatusSet).length) {
var deets = extractInstanceDeets(r.instanceStatusSet.item);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment