Open kief opened 7 years ago
I've submitted pull request #202.
As I mentioned in the pull request, it's not a complete solution - if the id isn't found (as an instance id or Name tag), then it returns a nil. This results in the same stacktrace.
If you have a preference for what to do instead, I can amend it. Ideally, the spec that calls it should simply fail. So this code:
describe ec2('My Server') do
it { should exist }
end
The should exist
check should simply return false. I'm not familiar enough with the codebase (or rspec code) to work out the best solution. Again, if you have pointers I can work on it some more.
Hi @kief .
I re-check find_ec2_status
code.
So I think find_ec2_status
return only 1 response or not.
(see https://github.com/k1LoW/awspec/blob/master/lib/awspec/helper/finder/ec2.rb#L31)
Because find_ec2_status use instance id
( not name )
Best regards.
If there are two server instances with the same Name tag (even if one is terminated), the following code fails with a stack trace:
The trace is:
Instead, Awspec::DuplicatedResourceTypeErro should be raised.