providers/azurerm: don't leak the context cancellation function

This commit is contained in:
Mitchell Hashimoto 2016-10-25 11:47:47 -07:00
parent 61bbaf6f85
commit d7402d0473
No known key found for this signature in database
GPG Key ID: 744E147AA52F5B0A
1 changed files with 2 additions and 1 deletions

View File

@ -193,9 +193,10 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e
}
// Create
cancelCtx, _ := context.WithTimeout(client.StopContext, 1*time.Hour)
cancelCtx, cancelFunc := context.WithTimeout(client.StopContext, 1*time.Hour)
_, createErr := storageClient.Create(
resourceGroupName, storageAccountName, opts, cancelCtx.Done())
cancelFunc()
// The only way to get the ID back apparently is to read the resource again
read, err := storageClient.GetProperties(resourceGroupName, storageAccountName)