Skip to content

Commit

Permalink
fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-henglu committed Jun 22, 2021
1 parent e551800 commit bc9d313
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"log"
"time"

"github.com/hashicorp/go-azure-helpers/response"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure"
"github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf"
Expand Down Expand Up @@ -200,9 +199,6 @@ func resourceDataProtectionBackupInstancePostgreSQLDelete(d *schema.ResourceData

future, err := client.Delete(ctx, id.BackupVaultName, id.ResourceGroup, id.Name)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
}
return fmt.Errorf("deleting DataProtection BackupInstance (%q): %+v", id, err)
}

Expand All @@ -218,6 +214,9 @@ func policyProtectionStateRefreshFunc(ctx context.Context, client *dataprotectio
if err != nil {
return nil, "", fmt.Errorf("retrieving DataProtection BackupInstance (%q): %+v", id, err)
}
if res.Properties == nil || res.Properties.ProtectionStatus == nil {
return nil, "", fmt.Errorf("error reading DataProtection BackupInstance (%q) protection status: %+v", id, err)
}

return res, string(res.Properties.ProtectionStatus.Status), nil
}
Expand Down

0 comments on commit bc9d313

Please sign in to comment.