Skip to content

Commit

Permalink
update resource naming for consistency; fix wrong timeout used in vir…
Browse files Browse the repository at this point in the history
…tual networks
  • Loading branch information
Thiryn committed Oct 29, 2024
1 parent fbcf514 commit eca6a1d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion opennebula/resource_opennebula_virtual_network.go
Original file line number Diff line number Diff line change
Expand Up @@ -1694,7 +1694,7 @@ func resourceOpennebulaVirtualNetworkDelete(ctx context.Context, d *schema.Resou
}
log.Printf("[INFO] Successfully released reservered IP addresses.")

err = resource.RetryContext(ctx, d.Timeout(schema.TimeoutCreate), func() *resource.RetryError {
err = resource.RetryContext(ctx, d.Timeout(schema.TimeoutDelete), func() *resource.RetryError {
err = vnc.Delete()
if err != nil {
if strings.Contains(err.Error(), "Can not remove a virtual network with leases in use") {
Expand Down
16 changes: 8 additions & 8 deletions opennebula/resource_opennebula_virtual_router_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ func TestAccVirtualRouter(t *testing.T) {
resource.TestCheckResourceAttrSet("opennebula_virtual_router.test", "gid"),
resource.TestCheckResourceAttrSet("opennebula_virtual_router.test", "uname"),
resource.TestCheckResourceAttrSet("opennebula_virtual_router.test", "gname"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_IP_specified", "floating_ip", "true"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_IP_specified", "floating_only", "false"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_IP_specified", "ip", "172.16.100.160"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_ip_specified", "floating_ip", "true"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_ip_specified", "floating_only", "false"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_ip_specified", "ip", "172.16.100.160"),
testAccCheckVirtualRouterPermissions(&shared.Permissions{
OwnerU: 1,
OwnerM: 1,
Expand All @@ -216,9 +216,9 @@ func TestAccVirtualRouter(t *testing.T) {
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_only_IP_specified", "floating_ip", "true"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_only_IP_specified", "floating_only", "true"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_only_IP_specified", "ip", "172.16.100.121"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_IP_specified", "floating_ip", "true"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_IP_specified", "floating_only", "false"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_IP_specified", "ip", "172.16.100.160"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_ip_specified", "floating_ip", "true"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_ip_specified", "floating_only", "false"),
resource.TestCheckResourceAttr("opennebula_virtual_router_nic.nic_floating_ip_specified", "ip", "172.16.100.160"),
testAccCheckVirtualRouterPermissions(&shared.Permissions{
OwnerU: 1,
OwnerM: 1,
Expand Down Expand Up @@ -641,7 +641,7 @@ resource "opennebula_virtual_router" "test" {
}
}
resource "opennebula_virtual_router_nic" "nic_floating_IP_specified" {
resource "opennebula_virtual_router_nic" "nic_floating_ip_specified" {
depends_on = [opennebula_virtual_router_instance.test]
ip = "172.16.100.160"
floating_ip = true
Expand Down Expand Up @@ -690,7 +690,7 @@ resource "opennebula_virtual_router_nic" "nic_floating_only_IP_specified" {
network_id = opennebula_virtual_network.network2.id
}
resource "opennebula_virtual_router_nic" "nic_floating_IP_specified" {
resource "opennebula_virtual_router_nic" "nic_floating_ip_specified" {
depends_on = [opennebula_virtual_router_instance.test]
ip = "172.16.100.160"
floating_ip = true
Expand Down

0 comments on commit eca6a1d

Please sign in to comment.