Skip to content

Commit

Permalink
Compute network id test update
Browse files Browse the repository at this point in the history
  • Loading branch information
slevenick committed Nov 7, 2019
1 parent 6edf388 commit 6e04355
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions third_party/terraform/tests/resource_compute_network_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,19 @@ func testAccCheckComputeNetworkExists(n string, network *compute.Network) resour
return fmt.Errorf("Not found: %s", n)
}

if rs.Primary.ID == "" {
if rs.Primary.Attributes["name"] == "" {
return fmt.Errorf("No ID is set")
}

config := testAccProvider.Meta().(*Config)

found, err := config.clientCompute.Networks.Get(
config.Project, rs.Primary.ID).Do()
config.Project, rs.Primary.Attributes["name"]).Do()
if err != nil {
return err
}

if found.Name != rs.Primary.ID {
if found.Name != rs.Primary.Attributes["name"] {
return fmt.Errorf("Network not found")
}

Expand Down

0 comments on commit 6e04355

Please sign in to comment.