fixed possibly incorrectly returning destroyed

This commit is contained in:
Sam Clinckspoor 2015-06-26 20:16:21 +02:00
parent c22f271fb0
commit c92b7a980c
1 changed files with 3 additions and 6 deletions

View File

@ -191,15 +191,12 @@ func resourceAwsElasticacheParameterGroupDeleteRefreshFunc(
if _, err := conn.DeleteCacheParameterGroup(&deleteOpts); err != nil {
elasticahceerr, ok := err.(awserr.Error)
if !ok {
return d, "error", err
}
if elasticahceerr.Code() != "CacheParameterGroupNotFoundFault" {
if ok && elasticahceerr.Code() == "CacheParameterGroupNotFoundFault" {
d.SetId("")
return d, "error", err
}
return d, "error", err
}
return d, "destroyed", nil
}
}