Skip to content

Commit

Permalink
fix error msgs
Browse files Browse the repository at this point in the history
  • Loading branch information
sdebruyn authored and sergelogvinov committed Jul 11, 2022
1 parent e0134cf commit 3a86e95
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ func dataSourceResourceGroupTemplateDeploymentRead(d *schema.ResourceData, meta
ctx, cancel := timeouts.ForRead(meta.(*clients.Client).StopContext, d)
defer cancel()

id := parse.NewResourceGroupTemplateDeploymentID(subscriptionId, d.Get("resource_group_name").(string), d.Get("name").(string))
resourceGroupName := d.Get("resource_group_name").(string)
deploymentName := d.Get("name").(string)
id := parse.NewResourceGroupTemplateDeploymentID(subscriptionId, resourceGroupName, deploymentName)

resp, err := client.Get(ctx, id.ResourceGroup, id.DeploymentName)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return fmt.Errorf("Resource Group %s was not found", *id)
return fmt.Errorf("template %s in resource Group %s was not found", deploymentName, resourceGroupName)
}

return fmt.Errorf("retrieving Template Deployment %q (Resource Group %q): %+v", id.DeploymentName, id.ResourceGroup, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func dataSourceSubscriptionTemplateDeploymentRead(d *schema.ResourceData, meta i
resp, err := client.GetAtSubscriptionScope(ctx, id.DeploymentName)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return fmt.Errorf("Subscription %s was not found", *id)
return fmt.Errorf("template %s in subscription %s was not found", id.DeploymentName, subscriptionId)
}

return fmt.Errorf("retrieving Subscription Template Deployment %q: %+v", id.DeploymentName, err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func dataSourceTenantTemplateDeploymentRead(d *schema.ResourceData, meta interfa
resp, err := client.GetAtTenantScope(ctx, id.DeploymentName)
if err != nil {
if utils.ResponseWasNotFound(resp.Response) {
return fmt.Errorf("Tenant %s was not found", *id)
return fmt.Errorf("template %s in tenant was not found", id.DeploymentName)
}

return fmt.Errorf("retrieving Tenant Template Deployment %q: %+v", id.DeploymentName, err)
Expand Down

0 comments on commit 3a86e95

Please sign in to comment.