Merge pull request #4552 from hashicorp/b-delete-azure-firewall-rule

provider/azure: Don't delete firewall rules on non-existent servers
This commit is contained in:
James Nugent 2016-01-07 11:03:30 -08:00
commit d612dcabad
1 changed files with 3 additions and 0 deletions

View File

@ -209,6 +209,9 @@ func resourceAzureSqlDatabaseServerFirewallRuleDelete(d *schema.ResourceData, me
// go ahead and delete the rule: // go ahead and delete the rule:
log.Printf("[INFO] Issuing deletion of Azure Database Server Firewall Rule %q in Server %q.", name, serverName) log.Printf("[INFO] Issuing deletion of Azure Database Server Firewall Rule %q in Server %q.", name, serverName)
if err := sqlClient.DeleteFirewallRule(serverName, name); err != nil { if err := sqlClient.DeleteFirewallRule(serverName, name); err != nil {
if strings.Contains(err.Error(), "Cannot open server") {
break
}
return fmt.Errorf("Error deleting Azure Database Server Firewall Rule %q for Server %q: %s", name, serverName, err) return fmt.Errorf("Error deleting Azure Database Server Firewall Rule %q for Server %q: %s", name, serverName, err)
} }