Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Comments

fixes #207#208

Closed
savaki wants to merge 3 commits intohashicorp:masterfrom
savaki:master
Closed

fixes #207#208
savaki wants to merge 3 commits intohashicorp:masterfrom
savaki:master

Conversation

@savaki
Copy link

@savaki savaki commented Jul 21, 2013

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

- adds a separate check to see if the return code from amazon was ami
instance not found
- added test cases
@kwilczynski
Copy link
Contributor

@savaki thank for this, but you seem to excessively and rather inappropriately use panic() in your tests.

@savaki
Copy link
Author

savaki commented Jul 24, 2013

How about this instead? I've changed the panics to t.Fatal

@kwilczynski
Copy link
Contributor

@savaki 👍

@savaki
Copy link
Author

savaki commented Jul 26, 2013

Is there anything else you'd like me to do before accepting this pull request?

@kwilczynski
Copy link
Contributor

@savaki I cannot accept it, its up to @mitchellh. I can only suggest that if you want to discard log messages, you could wrap logger and make os.Stdout use ioutil.Discard, but that has no bearing on the PR.

@mitchellh
Copy link
Contributor

@savaki This pull has a lot of great stuff! Because of some changes I made to the Amazon stuff, it can't merge cleanly. I manually applied the change that specifically fixes #207. But some other changes in here are great too, such as the timeout stuff.

I'm sorry I couldn't merge in your specific commit. Feel free to open another pull with the timeout, for example.

@mitchellh mitchellh closed this Jul 26, 2013
@ghost ghost locked and limited conversation to collaborators Apr 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants