Skip to content

Commit

Permalink
Added workaround to data center resource test for hashicorp/terraform…
Browse files Browse the repository at this point in the history
  • Loading branch information
anandkunal committed Jan 1, 2020
1 parent dcf26dd commit 88d1f18
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions incapsula/resource_data_center_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ func testAccCheckIncapsulaDataCenterDestroy(state *terraform.State) error {
}

listDataCenterResponse, _ := client.ListDataCenters(siteID)

// See comment above - the data center may have already been deleted
// This workaround will be removed in the future
if listDataCenterResponse == nil || listDataCenterResponse.DCs == nil || len(listDataCenterResponse.DCs) == 0 {
return nil
}

for _, dc := range listDataCenterResponse.DCs {
if dc.Name == dataCenterName {
return fmt.Errorf("Incapsula data center: %s (site_id: %s) still exists", dataCenterName, siteID)
Expand Down

0 comments on commit 88d1f18

Please sign in to comment.