provider/azure: Fix up destroy checks
This commit is contained in:
parent
9346355ed5
commit
f0ce107971
|
@ -2,6 +2,7 @@ package azure
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
|
@ -149,6 +150,10 @@ func testAccAzureDatabaseServerFirewallRuleDeleted(servers []string) resource.Te
|
|||
for _, server := range servers {
|
||||
rules, err := sqlClient.ListFirewallRules(server)
|
||||
if err != nil {
|
||||
// ¯\_(ツ)_/¯
|
||||
if strings.Contains(err.Error(), "Cannot open server") {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Error listing Azure Database Server Firewall Rules for Server %q: %s", server, err)
|
||||
}
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package azure
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
|
@ -146,6 +147,10 @@ func testAccCheckAzureSqlDatabaseServiceDeleted(s *terraform.State) error {
|
|||
sqlClient := testAccProvider.Meta().(*Client).sqlClient
|
||||
dbs, err := sqlClient.ListDatabases(*testAccAzureSqlServerName)
|
||||
if err != nil {
|
||||
// ¯\_(ツ)_/¯
|
||||
if strings.Contains(err.Error(), "Cannot open server") {
|
||||
return nil
|
||||
}
|
||||
return fmt.Errorf("Error issuing Azure SQL Service list request: %s", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue