Skip to content

Commit

Permalink
use passed ctx
Browse files Browse the repository at this point in the history
  • Loading branch information
jackofallops committed Feb 15, 2021
1 parent 68d8264 commit 4c1e7f5
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions azurerm/internal/services/compute/virtual_machine.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import (
msiparse "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/msi/parse"
msivalidate "github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/services/msi/validate"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/tf/suppress"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/internal/timeouts"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils"
)

Expand Down Expand Up @@ -576,7 +575,7 @@ func expandVirtualMachineDataDisks(ctx context.Context, d *schema.ResourceData,
}

if existingDisksRaw, ok := dataDisks["existing"]; ok {
existingDisks, err := expandVirtualMachineExistingDataDisksForCreate(existingDisksRaw, d, meta)
existingDisks, err := expandVirtualMachineExistingDataDisksForCreate(ctx, existingDisksRaw, d, meta)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -669,14 +668,12 @@ func expandVirtualMachineLocalDataDisksForUpdate(ctx context.Context, input inte
return dataDisks, nil
}

func expandVirtualMachineExistingDataDisksForCreate(input interface{}, d *schema.ResourceData, meta interface{}) ([]compute.DataDisk, error) {
func expandVirtualMachineExistingDataDisksForCreate(ctx context.Context, input interface{}, d *schema.ResourceData, meta interface{}) ([]compute.DataDisk, error) {
if input == nil || len(input.(*schema.Set).List()) == 0 {
return []compute.DataDisk{}, nil
}

disksClient := meta.(*clients.Client).Compute.DisksClient
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

var dataDisks []compute.DataDisk

Expand Down

0 comments on commit 4c1e7f5

Please sign in to comment.