mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
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.
This commit is contained in:
parent
fcaa3d9194
commit
335d8fa1e6
@ -152,7 +152,7 @@ func testAccCheckCloudStackDiskDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.Volume.NewDeleteVolumeParams(rs.Primary.ID)
|
p := cs.Volume.NewDeleteVolumeParams(rs.Primary.ID)
|
||||||
err, _ := cs.Volume.DeleteVolume(p)
|
_, err := cs.Volume.DeleteVolume(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
@ -177,7 +177,7 @@ func testAccCheckCloudStackDiskDestroyAdvanced(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.Volume.NewDeleteVolumeParams(rs.Primary.ID)
|
p := cs.Volume.NewDeleteVolumeParams(rs.Primary.ID)
|
||||||
err, _ := cs.Volume.DeleteVolume(p)
|
_, err := cs.Volume.DeleteVolume(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
@ -196,7 +196,7 @@ func testAccCheckCloudStackDiskDestroyAdvanced(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID)
|
p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID)
|
||||||
err, _ := cs.VirtualMachine.DestroyVirtualMachine(p)
|
_, err := cs.VirtualMachine.DestroyVirtualMachine(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -173,7 +173,7 @@ func testAccCheckCloudStackInstanceDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID)
|
p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID)
|
||||||
err, _ := cs.VirtualMachine.DestroyVirtualMachine(p)
|
_, err := cs.VirtualMachine.DestroyVirtualMachine(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -104,7 +104,7 @@ func testAccCheckCloudStackIPAddressDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.Address.NewDisassociateIpAddressParams(rs.Primary.ID)
|
p := cs.Address.NewDisassociateIpAddressParams(rs.Primary.ID)
|
||||||
err, _ := cs.Address.DisassociateIpAddress(p)
|
_, err := cs.Address.DisassociateIpAddress(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -87,7 +87,7 @@ func testAccCheckCloudStackNetworkACLDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.NetworkACL.NewDeleteNetworkACLListParams(rs.Primary.ID)
|
p := cs.NetworkACL.NewDeleteNetworkACLListParams(rs.Primary.ID)
|
||||||
err, _ := cs.NetworkACL.DeleteNetworkACLList(p)
|
_, err := cs.NetworkACL.DeleteNetworkACLList(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -141,7 +141,7 @@ func testAccCheckCloudStackNetworkDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.Network.NewDeleteNetworkParams(rs.Primary.ID)
|
p := cs.Network.NewDeleteNetworkParams(rs.Primary.ID)
|
||||||
err, _ := cs.Network.DeleteNetwork(p)
|
_, err := cs.Network.DeleteNetwork(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -141,7 +141,7 @@ func testAccCheckCloudStackNICDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID)
|
p := cs.VirtualMachine.NewDestroyVirtualMachineParams(rs.Primary.ID)
|
||||||
err, _ := cs.VirtualMachine.DestroyVirtualMachine(p)
|
_, err := cs.VirtualMachine.DestroyVirtualMachine(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
@ -93,7 +93,7 @@ func testAccCheckCloudStackVPCDestroy(s *terraform.State) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
p := cs.VPC.NewDeleteVPCParams(rs.Primary.ID)
|
p := cs.VPC.NewDeleteVPCParams(rs.Primary.ID)
|
||||||
err, _ := cs.VPC.DeleteVPC(p)
|
_, err := cs.VPC.DeleteVPC(p)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf(
|
return fmt.Errorf(
|
||||||
|
Loading…
Reference in New Issue
Block a user