Skip to content

Commit

Permalink
code cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
catsby committed Jun 9, 2015
1 parent 5f1ab2a commit 4d59019
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion builtin/providers/aws/resource_aws_iam_group_membership.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ func resourceAwsIamGroupMembershipDelete(d *schema.ResourceData, meta interface{
return err
}

d.SetId("")
return nil
}

Expand Down
11 changes: 9 additions & 2 deletions builtin/providers/aws/resource_aws_iam_group_membership_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,22 @@ func testAccCheckAWSGroupMembershipDestroy(s *terraform.State) error {

group := rs.Primary.Attributes["group"]

_, err := conn.GetGroup(&iam.GetGroupInput{
resp, err := conn.GetGroup(&iam.GetGroupInput{
GroupName: aws.String(group),
})
if err != nil {
// might error here
return err
}

return fmt.Errorf("Error: Group (%s) still exists", group)
users := []string{"test-user", "test-user-two", "test-user-three"}
for _, u := range resp.Users {
for _, i := range users {
if i == *u.UserName {
return fmt.Errorf("Error: User (s) still a member of Group (%s)", i, *resp.Group.GroupName)
}
}
}

}

Expand Down

0 comments on commit 4d59019

Please sign in to comment.