From 335d8fa1e6f5a541cc344476148591ba70890fd5 Mon Sep 17 00:00:00 2001 From: Emil Hessman Date: Wed, 14 Jan 2015 19:54:29 +0100 Subject: [PATCH] builtin/providers/cloudstack: fix err checks in tests Wrong return value is used to determine if an error occured. Make sure to check the actual Error value that the functions return. --- .../providers/cloudstack/resource_cloudstack_disk_test.go | 6 +++--- .../cloudstack/resource_cloudstack_instance_test.go | 2 +- .../cloudstack/resource_cloudstack_ipaddress_test.go | 2 +- .../cloudstack/resource_cloudstack_network_acl_test.go | 2 +- .../cloudstack/resource_cloudstack_network_test.go | 2 +- .../providers/cloudstack/resource_cloudstack_nic_test.go | 2 +- .../providers/cloudstack/resource_cloudstack_vpc_test.go | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/builtin/providers/cloudstack/resource_cloudstack_disk_test.go b/builtin/providers/cloudstack/resource_cloudstack_disk_test.go index aa17eeeb39..0f4b49c77c 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_disk_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_disk_test.go @@ -152,7 +152,7 @@ func testAccCheckCloudStackDiskDestroy(s *terraform.State) error { } p := cs.Volume.NewDeleteVolumeParams(rs.Primary.ID) - err, _ := cs.Volume.DeleteVolume(p) + _, err := cs.Volume.DeleteVolume(p) if err != nil { return fmt.Errorf( @@ -177,7 +177,7 @@ func testAccCheckCloudStackDiskDestroyAdvanced(s *terraform.State) error { } p := cs.Volume.NewDeleteVolumeParams(rs.Primary.ID) - err, _ := cs.Volume.DeleteVolume(p) + _, err := cs.Volume.DeleteVolume(p) if err != nil { return fmt.Errorf( @@ -196,7 +196,7 @@ func testAccCheckCloudStackDiskDestroyAdvanced(s *terraform.State) error { } p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID) - err, _ := cs.VirtualMachine.DestroyVirtualMachine(p) + _, err := cs.VirtualMachine.DestroyVirtualMachine(p) if err != nil { return fmt.Errorf( diff --git a/builtin/providers/cloudstack/resource_cloudstack_instance_test.go b/builtin/providers/cloudstack/resource_cloudstack_instance_test.go index 47a47253c9..2d1be9c530 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_instance_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_instance_test.go @@ -173,7 +173,7 @@ func testAccCheckCloudStackInstanceDestroy(s *terraform.State) error { } p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID) - err, _ := cs.VirtualMachine.DestroyVirtualMachine(p) + _, err := cs.VirtualMachine.DestroyVirtualMachine(p) if err != nil { return fmt.Errorf( diff --git a/builtin/providers/cloudstack/resource_cloudstack_ipaddress_test.go b/builtin/providers/cloudstack/resource_cloudstack_ipaddress_test.go index 88fdaba406..5b1fc9a317 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_ipaddress_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_ipaddress_test.go @@ -104,7 +104,7 @@ func testAccCheckCloudStackIPAddressDestroy(s *terraform.State) error { } p := cs.Address.NewDisassociateIpAddressParams(rs.Primary.ID) - err, _ := cs.Address.DisassociateIpAddress(p) + _, err := cs.Address.DisassociateIpAddress(p) if err != nil { return fmt.Errorf( diff --git a/builtin/providers/cloudstack/resource_cloudstack_network_acl_test.go b/builtin/providers/cloudstack/resource_cloudstack_network_acl_test.go index 7ea42319d2..e625d4c2d8 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_network_acl_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_network_acl_test.go @@ -87,7 +87,7 @@ func testAccCheckCloudStackNetworkACLDestroy(s *terraform.State) error { } p := cs.NetworkACL.NewDeleteNetworkACLListParams(rs.Primary.ID) - err, _ := cs.NetworkACL.DeleteNetworkACLList(p) + _, err := cs.NetworkACL.DeleteNetworkACLList(p) if err != nil { return fmt.Errorf( diff --git a/builtin/providers/cloudstack/resource_cloudstack_network_test.go b/builtin/providers/cloudstack/resource_cloudstack_network_test.go index 6eb3094b8b..750761f020 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_network_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_network_test.go @@ -141,7 +141,7 @@ func testAccCheckCloudStackNetworkDestroy(s *terraform.State) error { } p := cs.Network.NewDeleteNetworkParams(rs.Primary.ID) - err, _ := cs.Network.DeleteNetwork(p) + _, err := cs.Network.DeleteNetwork(p) if err != nil { return fmt.Errorf( diff --git a/builtin/providers/cloudstack/resource_cloudstack_nic_test.go b/builtin/providers/cloudstack/resource_cloudstack_nic_test.go index 645b0b01da..1b0902be31 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_nic_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_nic_test.go @@ -141,7 +141,7 @@ func testAccCheckCloudStackNICDestroy(s *terraform.State) error { } p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID) - err, _ := cs.VirtualMachine.DestroyVirtualMachine(p) + _, err := cs.VirtualMachine.DestroyVirtualMachine(p) if err != nil { return fmt.Errorf( diff --git a/builtin/providers/cloudstack/resource_cloudstack_vpc_test.go b/builtin/providers/cloudstack/resource_cloudstack_vpc_test.go index 8142a9046e..bf4e8f448d 100644 --- a/builtin/providers/cloudstack/resource_cloudstack_vpc_test.go +++ b/builtin/providers/cloudstack/resource_cloudstack_vpc_test.go @@ -93,7 +93,7 @@ func testAccCheckCloudStackVPCDestroy(s *terraform.State) error { } p := cs.VPC.NewDeleteVPCParams(rs.Primary.ID) - err, _ := cs.VPC.DeleteVPC(p) + _, err := cs.VPC.DeleteVPC(p) if err != nil { return fmt.Errorf(