From d9c0b3e6bda47e4811686e5cdfd49ab82c439691 Mon Sep 17 00:00:00 2001 From: Paul Hinze Date: Fri, 8 Jan 2016 14:23:54 -0600 Subject: [PATCH] provider/azurerm: Additional fixes for upstream breaking changes More fixes for breaking changes introduced in: https://github.com/Azure/azure-sdk-for-go/pull/258 --- .../providers/azurerm/resource_arm_availability_set_test.go | 2 +- .../azurerm/resource_arm_network_security_group.go | 4 ++-- .../azurerm/resource_arm_network_security_group_test.go | 4 ++-- builtin/providers/azurerm/resource_arm_public_ip.go | 4 ++-- builtin/providers/azurerm/resource_arm_public_ip_test.go | 4 ++-- builtin/providers/azurerm/resource_arm_virtual_network.go | 6 +++--- .../providers/azurerm/resource_arm_virtual_network_test.go | 4 ++-- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/builtin/providers/azurerm/resource_arm_availability_set_test.go b/builtin/providers/azurerm/resource_arm_availability_set_test.go index 867b7484e..edbaf2589 100644 --- a/builtin/providers/azurerm/resource_arm_availability_set_test.go +++ b/builtin/providers/azurerm/resource_arm_availability_set_test.go @@ -95,7 +95,7 @@ func testCheckAzureRMAvailabilitySetDestroy(s *terraform.State) error { name := rs.Primary.Attributes["name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(resourceGroup, name) + resp, err := conn.Get(resourceGroup, name, "") if err != nil { return nil diff --git a/builtin/providers/azurerm/resource_arm_network_security_group.go b/builtin/providers/azurerm/resource_arm_network_security_group.go index c70522313..993d72236 100644 --- a/builtin/providers/azurerm/resource_arm_network_security_group.go +++ b/builtin/providers/azurerm/resource_arm_network_security_group.go @@ -176,7 +176,7 @@ func resourceArmNetworkSecurityGroupRead(d *schema.ResourceData, meta interface{ resGroup := id.ResourceGroup name := id.Path["networkSecurityGroups"] - resp, err := secGroupClient.Get(resGroup, name) + resp, err := secGroupClient.Get(resGroup, name, "") if resp.StatusCode == http.StatusNotFound { d.SetId("") return nil @@ -220,7 +220,7 @@ func resourceArmNetworkSecurityGroupRuleHash(v interface{}) int { func securityGroupStateRefreshFunc(client *ArmClient, resourceGroupName string, securityGroupName string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - res, err := client.secGroupClient.Get(resourceGroupName, securityGroupName) + res, err := client.secGroupClient.Get(resourceGroupName, securityGroupName, "") if err != nil { return nil, "", fmt.Errorf("Error issuing read request in securityGroupStateRefreshFunc to Azure ARM for network security group '%s' (RG: '%s'): %s", securityGroupName, resourceGroupName, err) } diff --git a/builtin/providers/azurerm/resource_arm_network_security_group_test.go b/builtin/providers/azurerm/resource_arm_network_security_group_test.go index 11dd75d7c..be815e1cc 100644 --- a/builtin/providers/azurerm/resource_arm_network_security_group_test.go +++ b/builtin/providers/azurerm/resource_arm_network_security_group_test.go @@ -182,7 +182,7 @@ func testCheckAzureRMNetworkSecurityGroupExists(name string) resource.TestCheckF conn := testAccProvider.Meta().(*ArmClient).secGroupClient - resp, err := conn.Get(resourceGroup, sgName) + resp, err := conn.Get(resourceGroup, sgName, "") if err != nil { return fmt.Errorf("Bad: Get on secGroupClient: %s", err) } @@ -206,7 +206,7 @@ func testCheckAzureRMNetworkSecurityGroupDestroy(s *terraform.State) error { name := rs.Primary.Attributes["name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(resourceGroup, name) + resp, err := conn.Get(resourceGroup, name, "") if err != nil { return nil diff --git a/builtin/providers/azurerm/resource_arm_public_ip.go b/builtin/providers/azurerm/resource_arm_public_ip.go index abd9245e0..0c5b03b26 100644 --- a/builtin/providers/azurerm/resource_arm_public_ip.go +++ b/builtin/providers/azurerm/resource_arm_public_ip.go @@ -159,7 +159,7 @@ func resourceArmPublicIpRead(d *schema.ResourceData, meta interface{}) error { resGroup := id.ResourceGroup name := id.Path["publicIPAddresses"] - resp, err := publicIPClient.Get(resGroup, name) + resp, err := publicIPClient.Get(resGroup, name, "") if resp.StatusCode == http.StatusNotFound { d.SetId("") return nil @@ -196,7 +196,7 @@ func resourceArmPublicIpDelete(d *schema.ResourceData, meta interface{}) error { func publicIPStateRefreshFunc(client *ArmClient, resourceGroupName string, publicIpName string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - res, err := client.publicIPClient.Get(resourceGroupName, publicIpName) + res, err := client.publicIPClient.Get(resourceGroupName, publicIpName, "") if err != nil { return nil, "", fmt.Errorf("Error issuing read request in publicIPStateRefreshFunc to Azure ARM for public ip '%s' (RG: '%s'): %s", publicIpName, resourceGroupName, err) } diff --git a/builtin/providers/azurerm/resource_arm_public_ip_test.go b/builtin/providers/azurerm/resource_arm_public_ip_test.go index 2b4fe1a75..c1e66762f 100644 --- a/builtin/providers/azurerm/resource_arm_public_ip_test.go +++ b/builtin/providers/azurerm/resource_arm_public_ip_test.go @@ -155,7 +155,7 @@ func testCheckAzureRMPublicIpExists(name string) resource.TestCheckFunc { conn := testAccProvider.Meta().(*ArmClient).publicIPClient - resp, err := conn.Get(resourceGroup, availSetName) + resp, err := conn.Get(resourceGroup, availSetName, "") if err != nil { return fmt.Errorf("Bad: Get on publicIPClient: %s", err) } @@ -179,7 +179,7 @@ func testCheckAzureRMPublicIpDestroy(s *terraform.State) error { name := rs.Primary.Attributes["name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(resourceGroup, name) + resp, err := conn.Get(resourceGroup, name, "") if err != nil { return nil diff --git a/builtin/providers/azurerm/resource_arm_virtual_network.go b/builtin/providers/azurerm/resource_arm_virtual_network.go index 305af5a76..1b3810ff6 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_network.go +++ b/builtin/providers/azurerm/resource_arm_virtual_network.go @@ -125,7 +125,7 @@ func resourceArmVirtualNetworkRead(d *schema.ResourceData, meta interface{}) err resGroup := id.ResourceGroup name := id.Path["virtualNetworks"] - resp, err := vnetClient.Get(resGroup, name) + resp, err := vnetClient.Get(resGroup, name, "") if resp.StatusCode == http.StatusNotFound { d.SetId("") return nil @@ -208,7 +208,7 @@ func getVirtualNetworkProperties(d *schema.ResourceData) *network.VirtualNetwork subnetObj.Properties.AddressPrefix = &prefix if secGroup != "" { - subnetObj.Properties.NetworkSecurityGroup = &network.SubResource{ + subnetObj.Properties.NetworkSecurityGroup = &network.SecurityGroup{ ID: &secGroup, } } @@ -240,7 +240,7 @@ func resourceAzureSubnetHash(v interface{}) int { func virtualNetworkStateRefreshFunc(client *ArmClient, resourceGroupName string, networkName string) resource.StateRefreshFunc { return func() (interface{}, string, error) { - res, err := client.vnetClient.Get(resourceGroupName, networkName) + res, err := client.vnetClient.Get(resourceGroupName, networkName, "") if err != nil { return nil, "", fmt.Errorf("Error issuing read request in virtualNetworkStateRefreshFunc to Azure ARM for virtual network '%s' (RG: '%s'): %s", networkName, resourceGroupName, err) } diff --git a/builtin/providers/azurerm/resource_arm_virtual_network_test.go b/builtin/providers/azurerm/resource_arm_virtual_network_test.go index 41be2fa7d..b07e39435 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_network_test.go +++ b/builtin/providers/azurerm/resource_arm_virtual_network_test.go @@ -42,7 +42,7 @@ func testCheckAzureRMVirtualNetworkExists(name string) resource.TestCheckFunc { // Ensure resource group/virtual network combination exists in API conn := testAccProvider.Meta().(*ArmClient).vnetClient - resp, err := conn.Get(resourceGroup, virtualNetworkName) + resp, err := conn.Get(resourceGroup, virtualNetworkName, "") if err != nil { return fmt.Errorf("Bad: Get on vnetClient: %s", err) } @@ -66,7 +66,7 @@ func testCheckAzureRMVirtualNetworkDestroy(s *terraform.State) error { name := rs.Primary.Attributes["name"] resourceGroup := rs.Primary.Attributes["resource_group_name"] - resp, err := conn.Get(resourceGroup, name) + resp, err := conn.Get(resourceGroup, name, "") if err != nil { return nil