Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checking the HTTP Response isn't nil. Fixes #200 #204

Merged
merged 3 commits into from
Aug 1, 2017
Merged

Conversation

tombuildsstuff
Copy link
Contributor

In the Read function for most resources we check the http response code before raising an error (to check if it's a 404 not found) - however issue #200 has highlighted an issue where it's possible for the response to be nil if the connection doesn't return a response / is dropped - which currently crashes.

This PR does two things:

  1. update the references to use a common validation method
  2. checks the Responses Response object isn't nil before checking the status code is a 404

I'm running the entire test suite now - but the Virtual Network tests have run through successfully:

$ TF_ACC=1 envchain azurerm go test ./azurerm -v -timeout 120m -run TestAccAzureRMVirtualNetwork
=== RUN   TestAccAzureRMVirtualNetworkPeering_importBasic
--- PASS: TestAccAzureRMVirtualNetworkPeering_importBasic (140.31s)
=== RUN   TestAccAzureRMVirtualNetwork_importBasic
--- PASS: TestAccAzureRMVirtualNetwork_importBasic (89.01s)
=== RUN   TestAccAzureRMVirtualNetworkPeering_basic
--- PASS: TestAccAzureRMVirtualNetworkPeering_basic (140.09s)
=== RUN   TestAccAzureRMVirtualNetworkPeering_disappears
--- PASS: TestAccAzureRMVirtualNetworkPeering_disappears (123.54s)
=== RUN   TestAccAzureRMVirtualNetworkPeering_update
--- PASS: TestAccAzureRMVirtualNetworkPeering_update (167.10s)
=== RUN   TestAccAzureRMVirtualNetwork_basic
--- PASS: TestAccAzureRMVirtualNetwork_basic (76.22s)
=== RUN   TestAccAzureRMVirtualNetwork_disappears
--- PASS: TestAccAzureRMVirtualNetwork_disappears (89.03s)
=== RUN   TestAccAzureRMVirtualNetwork_withTags
--- PASS: TestAccAzureRMVirtualNetwork_withTags (105.97s)
PASS
ok  	github.com/terraform-providers/terraform-provider-azurerm/azurerm	931.292s

Fixes #200

@tombuildsstuff tombuildsstuff mentioned this pull request Aug 1, 2017
@tombuildsstuff tombuildsstuff requested review from radeksimko and mbfrahry and removed request for radeksimko August 1, 2017 12:21
Copy link
Member

@mbfrahry mbfrahry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@tombuildsstuff tombuildsstuff merged commit 85e9617 into master Aug 1, 2017
@tombuildsstuff tombuildsstuff deleted the no-response branch August 1, 2017 15:46
tombuildsstuff added a commit that referenced this pull request Aug 1, 2017
@ghost
Copy link

ghost commented Apr 1, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Terraform Crash
2 participants