Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

future.WaitForCompletion() -> future.WaitForCompletionRef() #1660

Merged
merged 1 commit into from
Jul 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion azurerm/data_source_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ func dataSourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error
if err != nil {
return err
}
err = siteCredFuture.WaitForCompletion(ctx, client.Client)
err = siteCredFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
8 changes: 4 additions & 4 deletions azurerm/resource_arm_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ func resourceArmAppServiceCreate(d *schema.ResourceData, meta interface{}) error
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -289,7 +289,7 @@ func resourceArmAppServiceUpdate(d *schema.ResourceData, meta interface{}) error
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -364,7 +364,7 @@ func resourceArmAppServiceUpdate(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error updating Managed Service Identity for App Service %q: %+v", name, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)

if err != nil {
return fmt.Errorf("Error updating Managed Service Identity for App Service %q: %+v", name, err)
Expand Down Expand Up @@ -420,7 +420,7 @@ func resourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error {
if err != nil {
return err
}
err = siteCredFuture.WaitForCompletion(ctx, client.Client)
err = siteCredFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_app_service_active_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func resourceArmAppServiceActiveSlotCreate(d *schema.ResourceData, meta interfac
if err != nil {
return fmt.Errorf("Error swapping App Service Slot %q/%q: %+v", appServiceName, targetSlot, err)
}
err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error swapping App Service Slot %q/%q: %+v", appServiceName, targetSlot, err)
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_app_service_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ func resourceArmAppServicePlanCreateUpdate(d *schema.ResourceData, meta interfac
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_app_service_slot.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func resourceArmAppServiceSlotCreate(d *schema.ResourceData, meta interface{}) e
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -253,7 +253,7 @@ func resourceArmAppServiceSlotUpdate(d *schema.ResourceData, meta interface{}) e
return err
}

err = createFuture.WaitForCompletion(ctx, client.Client)
err = createFuture.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_application_gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ func resourceArmApplicationGatewayCreateUpdate(d *schema.ResourceData, meta inte
return fmt.Errorf("Error Creating/Updating ApplicationGateway %q (Resource Group %q): %+v", name, resGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error Creating/Updating ApplicationGateway %q (Resource Group %q): %+v", name, resGroup, err)
}
Expand Down Expand Up @@ -857,7 +857,7 @@ func resourceArmApplicationGatewayDelete(d *schema.ResourceData, meta interface{
return fmt.Errorf("Error deleting for AppGateway %q (Resource Group %q): %+v", name, resGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for deletion of AppGateway %q (Resource Group %q): %+v", name, resGroup, err)
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_application_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func testSweepApplicationGateways(region string) error {
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
continue
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_application_security_group.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func resourceArmApplicationSecurityGroupCreateUpdate(d *schema.ResourceData, met
return fmt.Errorf("Error creating Application Security Group %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for the Application Security Group %q (Resource Group %q) to finish creating: %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -123,7 +123,7 @@ func resourceArmApplicationSecurityGroupDelete(d *schema.ResourceData, meta inte
}
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if !response.WasNotFound(future.Response()) {
return fmt.Errorf("Error waiting for deletion of Application Security Group %q (Resource Group %q): %+v", name, resourceGroup, err)
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_cdn_endpoint.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ func resourceArmCdnEndpointCreate(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error creating CDN Endpoint %q (Profile %q / Resource Group %q): %+v", name, profileName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for CDN Endpoint %q (Profile %q / Resource Group %q) to finish creating: %+v", name, profileName, resourceGroup, err)
}
Expand Down Expand Up @@ -312,7 +312,7 @@ func resourceArmCdnEndpointUpdate(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error updating CDN Endpoint %q (Profile %q / Resource Group %q): %s", name, profileName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, endpointsClient.Client)
err = future.WaitForCompletionRef(ctx, endpointsClient.Client)
if err != nil {
return fmt.Errorf("Error waiting for the CDN Endpoint %q (Profile %q / Resource Group %q) to finish updating: %+v", name, profileName, resourceGroup, err)
}
Expand Down Expand Up @@ -408,7 +408,7 @@ func resourceArmCdnEndpointDelete(d *schema.ResourceData, meta interface{}) erro
return fmt.Errorf("Error deleting CDN Endpoint %q (Profile %q / Resource Group %q): %+v", name, profileName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_cdn_endpoint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ func testCheckAzureRMCdnEndpointDisappears(name string) resource.TestCheckFunc {
return fmt.Errorf("Bad: Delete on cdnEndpointsClient: %+v", err)
}

err = future.WaitForCompletion(ctx, conn.Client)
err = future.WaitForCompletionRef(ctx, conn.Client)
if err != nil {
return fmt.Errorf("Bad: Delete on cdnEndpointsClient: %+v", err)
}
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_cdn_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ func resourceArmCdnProfileCreate(d *schema.ResourceData, meta interface{}) error
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -116,7 +116,7 @@ func resourceArmCdnProfileUpdate(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error issuing update request for CDN Profile %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for the update of CDN Profile %q (Resource Group %q) to commplete: %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -178,7 +178,7 @@ func resourceArmCdnProfileDelete(d *schema.ResourceData, meta interface{}) error
return fmt.Errorf("Error issuing delete request for CDN Profile %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_cdn_profile_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func testSweepCDNProfiles(region string) error {
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_container_registry.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ func resourceArmContainerRegistryCreate(d *schema.ResourceData, meta interface{}
return fmt.Errorf("Error creating Container Registry %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for creation of Container Registry %q (Resource Group %q): %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -208,7 +208,7 @@ func resourceArmContainerRegistryUpdate(d *schema.ResourceData, meta interface{}
return fmt.Errorf("Error updating Container Registry %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for update of Container Registry %q (Resource Group %q): %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -305,7 +305,7 @@ func resourceArmContainerRegistryDelete(d *schema.ResourceData, meta interface{}
return fmt.Errorf("Error issuing Azure ARM delete request of Container Registry '%s': %+v", name, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_container_registry_migrate_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ func createStorageAccount(client *ArmClient, resourceGroupName, storageAccountNa
return nil, fmt.Errorf("Error creating Storage Account %q: %+v", resourceGroupName, err)
}

err = future.WaitForCompletion(ctx, storageClient.Client)
err = future.WaitForCompletionRef(ctx, storageClient.Client)
if err != nil {
return nil, fmt.Errorf("Error waiting for creation of Storage Account %q: %+v", resourceGroupName, err)
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_container_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ func resourceArmContainerServiceDelete(d *schema.ResourceData, meta interface{})
return fmt.Errorf("Error issuing Azure ARM delete request of Container Service '%s': %s", name, err)
}

err = future.WaitForCompletion(ctx, containerServiceClient.Client)
err = future.WaitForCompletionRef(ctx, containerServiceClient.Client)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_cosmos_db_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -617,7 +617,7 @@ func resourceArmCosmosDBAccountApiUpsert(client documentdb.DatabaseAccountsClien
return nil, fmt.Errorf("Error creating/updating CosmosDB Account %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return nil, fmt.Errorf("Error waiting for the CosmosDB Account %q (Resource Group %q) to finish creating/updating: %+v", name, resourceGroup, err)
}
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_cosmos_db_account_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func testSweepCosmosDBAccount(region string) error {
if err != nil {
return err
}
err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_data_lake_analytics_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ func resourceArmDateLakeAnalyticsAccountCreate(d *schema.ResourceData, meta inte
return fmt.Errorf("Error issuing create request for Data Lake Analytics Account %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error creating Data Lake Analytics Account %q (Resource Group %q): %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -145,7 +145,7 @@ func resourceArmDateLakeAnalyticsAccountUpdate(d *schema.ResourceData, meta inte
return fmt.Errorf("Error issuing update request for Data Lake Analytics Account %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for the update of Data Lake Analytics Account %q (Resource Group %q) to commplete: %+v", name, resourceGroup, err)
}
Expand Down Expand Up @@ -210,7 +210,7 @@ func resourceArmDateLakeAnalyticsAccountDelete(d *schema.ResourceData, meta inte
return fmt.Errorf("Error issuing delete request for Data Lake Analytics Account %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_data_lake_store.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ func resourceArmDateLakeStoreDelete(d *schema.ResourceData, meta interface{}) er
return fmt.Errorf("Error issuing delete request for Data Lake Store %q (Resource Group %q): %+v", name, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_dns_zone.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ func resourceArmDnsZoneDelete(d *schema.ResourceData, meta interface{}) error {
return fmt.Errorf("Error deleting DNS zone %s (resource group %s): %+v", name, resGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_eventgrid_topic.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func resourceArmEventGridTopicCreateUpdate(d *schema.ResourceData, meta interfac
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -157,7 +157,7 @@ func resourceArmEventGridTopicDelete(d *schema.ResourceData, meta interface{}) e
return fmt.Errorf("Error deleting Event Grid Topic %q: %+v", name, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
2 changes: 1 addition & 1 deletion azurerm/resource_arm_eventhub_namespace.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func resourceArmEventHubNamespaceCreate(d *schema.ResourceData, meta interface{}
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error creating eventhub namespace: %+v", err)
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_express_route_circuit.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ func resourceArmExpressRouteCircuitCreateOrUpdate(d *schema.ResourceData, meta i
return fmt.Errorf("Error Creating/Updating ExpressRouteCircuit %q (Resource Group %q): %+v", name, resGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error Creating/Updating ExpressRouteCircuit %q (Resource Group %q): %+v", name, resGroup, err)
}
Expand Down Expand Up @@ -217,7 +217,7 @@ func resourceArmExpressRouteCircuitDelete(d *schema.ResourceData, meta interface
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_express_route_circuit_authorization.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func resourceArmExpressRouteCircuitAuthorizationCreateUpdate(d *schema.ResourceD
return fmt.Errorf("Error Creating/Updating Express Route Circuit Authorization %q (Circuit %q / Resource Group %q): %+v", name, circuitName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return fmt.Errorf("Error waiting for Express Route Circuit Authorization %q (Circuit %q / Resource Group %q) to finish creating/updating: %+v", name, circuitName, resourceGroup, err)
}
Expand Down Expand Up @@ -141,7 +141,7 @@ func resourceArmExpressRouteCircuitAuthorizationDelete(d *schema.ResourceData, m
return fmt.Errorf("Error deleting Express Route Circuit Authorization %q (Circuit %q / Resource Group %q): %+v", name, circuitName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
4 changes: 2 additions & 2 deletions azurerm/resource_arm_express_route_circuit_peering.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ func resourceArmExpressRouteCircuitPeeringCreateUpdate(d *schema.ResourceData, m
return err
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
return err
}
Expand Down Expand Up @@ -231,7 +231,7 @@ func resourceArmExpressRouteCircuitPeeringDelete(d *schema.ResourceData, meta in
return fmt.Errorf("Error issuing delete request for Express Route Circuit Peering %q (Circuit %q / Resource Group %q): %+v", peeringType, circuitName, resourceGroup, err)
}

err = future.WaitForCompletion(ctx, client.Client)
err = future.WaitForCompletionRef(ctx, client.Client)
if err != nil {
if response.WasNotFound(future.Response()) {
return nil
Expand Down
Loading