provider/azure: Fix up destroy checks

This commit is contained in:
James Nugent 2016-01-07 06:52:28 -08:00
parent 9346355ed5
commit f0ce107971
2 changed files with 10 additions and 0 deletions

View File

@ -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)
}

View File

@ -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)
}