mitchellh/packer — pull request #208 by savaki (2013-07-21 03:48:37+00:00)
Title: fixes #207

Mitchell, here's a fix for this issue. Here's what I did:

* extract the for loop into its own method
* externalized the call to ec2.Images into a method param to make testing easier
* added a global timeout on the for loop of 1 minute to ensure it would fail eventually
* replaced a few duplicate references to createResp.ImageId with a local variable, imageId
* added tests to handle various cases around waiting for the ami