provider/aws: fix ECS service CheckDestroy in tests

This commit is contained in:
Paul Hinze 2015-12-21 21:10:13 -06:00
parent f473c2a6d4
commit 47f8b0cd79
1 changed files with 5 additions and 0 deletions

View File

@ -6,6 +6,7 @@ import (
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
@ -210,6 +211,10 @@ func testAccCheckAWSEcsServiceDestroy(s *terraform.State) error {
Services: []*string{aws.String(rs.Primary.ID)},
})
if awserr, ok := err.(awserr.Error); ok && awserr.Code() == "ClusterNotFoundException" {
continue
}
if err == nil {
if len(out.Services) > 0 {
return fmt.Errorf("ECS service still exists:\n%#v", out.Services)