Merge pull request #4344 from hashicorp/b-aws-s3-test-fixes

provider/aws: Fix check destroy method for s3 tests
This commit is contained in:
James Nugent 2015-12-19 11:41:00 -05:00
commit c442ca3899
1 changed files with 4 additions and 0 deletions

View File

@ -14,6 +14,7 @@ import (
"github.com/hashicorp/terraform/terraform" "github.com/hashicorp/terraform/terraform"
"github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3"
) )
@ -265,6 +266,9 @@ func testAccCheckAWSS3BucketDestroy(s *terraform.State) error {
Bucket: aws.String(rs.Primary.ID), Bucket: aws.String(rs.Primary.ID),
}) })
if err != nil { if err != nil {
if awsErr, ok := err.(awserr.Error); ok && awsErr.Code() == "NoSuchBucket" {
return nil
}
return err return err
} }
} }