From 9346355ed593488b5c999c62c28f6b958a7edba8 Mon Sep 17 00:00:00 2001 From: James Nugent Date: Wed, 6 Jan 2016 16:11:45 -0800 Subject: [PATCH 1/2] provider/azure: Wait longer for storage blob to go --- builtin/providers/azure/resource_azure_instance.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/builtin/providers/azure/resource_azure_instance.go b/builtin/providers/azure/resource_azure_instance.go index 097b210f5..1ad82c1f6 100644 --- a/builtin/providers/azure/resource_azure_instance.go +++ b/builtin/providers/azure/resource_azure_instance.go @@ -622,7 +622,7 @@ func resourceAzureInstanceDelete(d *schema.ResourceData, meta interface{}) error return err } - err = resource.Retry(5*time.Minute, func() error { + err = resource.Retry(15*time.Minute, func() error { exists, err := blobClient.BlobExists( storageContainterName, fmt.Sprintf(osDiskBlobNameFormat, name), ) From f0ce107971a7ce83eb202b49f20a130a7ba305da Mon Sep 17 00:00:00 2001 From: James Nugent Date: Thu, 7 Jan 2016 06:52:28 -0800 Subject: [PATCH 2/2] provider/azure: Fix up destroy checks --- .../resource_azure_sql_database_server_firewall_rule_test.go | 5 +++++ .../azure/resource_azure_sql_database_service_test.go | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/builtin/providers/azure/resource_azure_sql_database_server_firewall_rule_test.go b/builtin/providers/azure/resource_azure_sql_database_server_firewall_rule_test.go index 9202be7e1..cdd0ab457 100644 --- a/builtin/providers/azure/resource_azure_sql_database_server_firewall_rule_test.go +++ b/builtin/providers/azure/resource_azure_sql_database_server_firewall_rule_test.go @@ -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) } diff --git a/builtin/providers/azure/resource_azure_sql_database_service_test.go b/builtin/providers/azure/resource_azure_sql_database_service_test.go index 24d865774..31ea8990e 100644 --- a/builtin/providers/azure/resource_azure_sql_database_service_test.go +++ b/builtin/providers/azure/resource_azure_sql_database_service_test.go @@ -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) }