Skip to content

Commit

Permalink
fix Batch account delete function
Browse files Browse the repository at this point in the history
  • Loading branch information
jcorioland committed Dec 5, 2018
1 parent f6dd46b commit ec101b5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion azurerm/resource_arm_batch_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package azurerm
import (
"fmt"
"log"
"net/http"
"regexp"

"github.com/Azure/azure-sdk-for-go/services/batch/mgmt/2017-09-01/batch"
Expand Down Expand Up @@ -193,7 +194,8 @@ func resourceArmBatchAccountDelete(d *schema.ResourceData, meta interface{}) err
}

err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
// if the error is not that the Batch account was not found
if err != nil && future.Response().StatusCode != http.StatusNotFound {
return fmt.Errorf("Error waiting for deletion of Batch account %q (Resource Group %q): %+v", name, resourceGroupName, err)
}

Expand Down

0 comments on commit ec101b5

Please sign in to comment.