opentofu/builtin/providers
stack72 392f634ff4
provider/azurerm: Reordering the checks after an Azure API Get
We are receiving suggestions of a panic as follows:

```
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic: runtime error: invalid memory address or nil pointer dereference
2016/09/01 07:21:55 [DEBUG] plugin: terraform: [signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=0xa3170f]
2016/09/01 07:21:55 [DEBUG] plugin: terraform:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: goroutine 114 [running]:
2016/09/01 07:21:55 [DEBUG] plugin: terraform: panic(0x27f4e60, 0xc4200100e0)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: 	/opt/go/src/runtime/panic.go:500 +0x1a1
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/builtin/providers/azurerm.resourceArmVirtualMachineRead(0xc4206d8060, 0x2995620, 0xc4204d0000, 0x0, 0x17)
2016/09/01 07:21:55 [DEBUG] plugin: terraform: 	/opt/gopath/src/github.com/hashicorp/terraform/builtin/providers/azurerm/resource_arm_virtual_machine.go:488 +0x1ff
2016/09/01 07:21:55 [DEBUG] plugin: terraform: github.com/hashicorp/terraform/helper/schema.(*Resource).Refresh(0xc420017a40, 0xc42040c780, 0x2995620, 0xc4204d0000, 0xc42019c990, 0x1, 0x0)
```

This is because the code is as follows:

```
resp, err := client.Get(resGroup, vnetName, name)
if resp.StatusCode == http.StatusNotFound {
	d.SetId("")
	return nil
}
if err != nil {
	return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
```

When a request throws an error, the response object isn't valid. Therefore, we need to flip that code to check the error first

```
resp, err := client.Get(resGroup, vnetName, name)
if err != nil {
	return fmt.Errorf("Error making Read request on Azure virtual network peering %s: %s", name, err)
}
if resp.StatusCode == http.StatusNotFound {
	d.SetId("")
	return nil
}
```
2016-09-01 15:31:42 +01:00
..
archive provider/archiver fix test output path breaking other tests (#8291) 2016-08-18 18:11:19 +01:00
atlas Add VersionString 2016-07-21 16:43:49 -04:00
aws provider/aws: Randomize some IAM user names to avoid conflicts in tests 2016-08-31 09:33:56 -05:00
azure provider/azure: add custom_data argument for azure_instance resource (#8158) 2016-08-14 11:02:49 +01:00
azurerm provider/azurerm: Reordering the checks after an Azure API Get 2016-09-01 15:31:42 +01:00
chef provider/chef: Fix go vet issues 2016-02-18 09:42:00 -08:00
clc [clc] add missing ForceNew on several fields 2016-05-11 11:39:35 -07:00
cloudflare provider/cloudflare: Add migration for v1 to v4 API libraries (#6969) 2016-06-07 14:29:25 -05:00
cloudstack Fix the acceptance tests and some cosmetic tweaks (#8598) 2016-09-01 11:19:37 +02:00
cobbler provider/cobbler: acc tests TF and script tweaks 2016-04-16 08:55:45 -05:00
consul Adds consul_prepared_query resource (#7474) 2016-08-18 08:46:30 +01:00
datadog provider/datadog: Govendor update dependencies (#8428) 2016-08-29 21:30:31 +01:00
digitalocean provider/digitalocean: Enforce Lowercase on IPV6 Addresses (#7652) 2016-08-15 15:52:48 +01:00
dme provider/dme: Add support for gtdLocation 2016-01-20 20:23:29 -05:00
dnsimple “DNS Simple” should be “DNSimple” 2015-07-17 23:18:28 -04:00
docker provider/docker: Added docker_registry_image data source (#7000) 2016-07-26 16:18:38 +01:00
dyn add Mutex so that we only do one Dyn operation at a time (extra thanks to @daveadams) 2015-09-21 10:01:32 -04:00
fastly provider/fastly: Change error text on findService 2016-08-31 12:53:56 +09:00
github provider/github: Remove unsafe ptr dereferencing (#8512) 2016-08-28 17:15:03 +01:00
google provider/google: Change Compute VPN Tunnel test to use the correct port range (#8504) 2016-08-27 00:51:57 +01:00
grafana Grafana Provider, with Data Source and Dashboard resources (#6206) 2016-05-20 10:20:17 +01:00
heroku builtin: Refactor resource.Retry to clarify return 2016-03-09 17:37:56 -06:00
influxdb Improve influxdb provider (#7333) 2016-08-05 16:27:03 +10:00
librato provider/librato: Fixing some go vet issues for the 2016-08-31 21:45:03 +01:00
logentries provider/logentries: Implementing logentries provider (#7067) 2016-07-12 14:14:39 +01:00
mailgun builtin: Refactor resource.Retry to clarify return 2016-03-09 17:37:56 -06:00
mysql use hashicorp/go-version to parse mysql server version 2016-08-31 10:50:08 +02:00
null provider/null: null_data_source data source 2016-05-14 08:26:37 -07:00
openstack Merge pull request #8172 from jtopjian/openstack-volumeattach-fix 2016-08-24 09:36:23 -06:00
packet provider/packet: Restructure the Packet Volume test to no longer rely on environment variables 2016-08-15 08:38:43 +01:00
postgresql provider/postgresql: default ssl_mode is "prefer" 2016-04-17 08:32:02 -07:00
powerdns provider/powerdns: Add support for PowerDNS 4 API (#7819) 2016-07-28 17:01:06 +01:00
random provider/random: random_shuffle resource 2016-05-14 16:48:45 -07:00
rundeck Only refresh project name if Rundeck server provides it. 2015-12-13 17:38:08 -08:00
scaleway provider/scaleway: Expose IPv6 support, improve documentation (#7784) 2016-07-25 12:49:09 +01:00
softlayer Added softlayer virtual guest and ssh keys functionality: 2016-05-03 15:58:58 -05:00
statuscake enable contact-group id in statuscake test 2016-08-23 14:43:31 +00:00
template providers/template: template_file supports floating point math 2016-08-31 17:25:11 -07:00
terraform provider/template: convert resources to data sources 2016-07-08 17:11:17 +01:00
test terraform: another set of ignore_changes fixes 2016-07-08 16:48:23 -05:00
tls Convert tls_cert_request to be a data source 2016-07-02 08:07:53 -07:00
triton provider/triton: Id trying to be used before being set 2016-08-30 23:19:04 +01:00
ultradns UltraDNS Provider 2016-03-20 12:10:59 -05:00
vcd builtin: Refactor resource.Retry to clarify return 2016-03-09 17:37:56 -06:00
vsphere Standardizing datastore references to use builting Path func (#8075) 2016-08-16 08:58:22 +01:00