Commit Graph

8 Commits

Author SHA1 Message Date
Paul Stack 54459900c5 [WIP] provider/azurerm: Bump sdk version to 7.0.1 (#10458)
* provider/azurerm: Bump sdk version to 7.0.1

* Fixing the build (#10489)

* Fixing the broken tests (#10499)

* Updating the method signatures to match (#10533)
2016-12-06 08:39:47 +00:00
Andreas Kyrris 00c0c75b16 Add tests to azurerm resources for cases where created resources
disappear.
2016-10-03 10:10:10 +01:00
Peter McAtominey 9fb9b67381 provider/azurerm: update Azure SDK
Based off master v4
2016-09-22 10:15:57 +01:00
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
James Nugent 0e3da1f98c provider/azurerm: Fix azurerm_local_network_gateway
```
HTTP_PROXY=http://localhost:8888 make testacc TEST=./builtin/providers/azurerm TESTARGS="-run TestAccAzureRMLocalNetworkGateway_"
==> Checking that code complies with gofmt requirements...
/Users/James/Code/go/bin/stringer
go generate $(go list ./... | grep -v /vendor/)
2016/06/01 18:59:05 Generated command/internal_plugin_list.go
TF_ACC=1 go test ./builtin/providers/azurerm -v -run TestAccAzureRMLocalNetworkGateway_ -timeout 120m
=== RUN   TestAccAzureRMLocalNetworkGateway_basic
--- PASS: TestAccAzureRMLocalNetworkGateway_basic (95.25s)
PASS
ok      github.com/hashicorp/terraform/builtin/providers/azurerm    95.260s
```
2016-06-01 19:52:56 -05:00
James Nugent 0769674c54 provider/azurerm: Use new library configuration
Most resources are commented out at this stage, as they require surgery
to make them work with the new world of the Azure SDK.
2016-06-01 19:52:55 -05:00
James Nugent 008dc970b6 provider/azurerm: Fix up network gateway tests
This diff represents the changes  necessary to make local network
gateway tests pass:

- Parse the resource ID instead of relying on attributes
- Remove unecessary logging (which is handled via the autorest wrapper)
- Resource GUID is removed - if this is actually required for anything
  we may need to find a way to supress it during apply, as we get
  spurious diffs in plans otherwise.
- Various typos fixed.
2015-12-23 18:49:21 +02:00
Nashwan Azhari 1eb129a99b provider/azure: added local network gateway resource 2015-12-23 18:49:21 +02:00