resources: aws: ec2: Remove extra wait from Watch

There were two calls to WaitUntilInstanceTerminatedWithContext in a row.
There's no reason to make the call twice.
This commit is contained in:
Jonathan Gold
2017-11-08 15:23:23 -05:00
parent baeafec74a
commit 987de00e17

View File

@@ -369,7 +369,6 @@ func (obj *AwsEc2Res) longpollWatch() error {
} }
} }
if obj.State == "terminated" { if obj.State == "terminated" {
obj.client.WaitUntilInstanceExistsWithContext(ctx, diInput)
if err := obj.client.WaitUntilInstanceExistsWithContext(ctx, diInput); err != nil { if err := obj.client.WaitUntilInstanceExistsWithContext(ctx, diInput); err != nil {
if aerr, ok := err.(awserr.Error); ok { if aerr, ok := err.(awserr.Error); ok {
if aerr.Code() == request.CanceledErrorCode { if aerr.Code() == request.CanceledErrorCode {