Skip to content

Commit

Permalink
Resolve last comments from review
Browse files Browse the repository at this point in the history
  • Loading branch information
joakimhew committed May 19, 2019
1 parent 59d5d48 commit cb8d8c1
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
9 changes: 8 additions & 1 deletion azurerm/helpers/azure/app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -838,10 +838,17 @@ func ExpandAppServiceAuthSettings(input []interface{}) web.SiteAuthSettingsPrope
}

func FlattenAdditionalLoginParams(input *[]string) map[string]interface{} {
result := make(map[string]interface{}, len(*input))
result := make(map[string]interface{}, 0)

if input == nil {
return result
}

for _, k := range *input {
parts := strings.Split(k, "=")
if len(parts) != 2 {
continue // Params not following the format `key=value` is considered malformed and will be ignored.
}
key := parts[0]
value := parts[1]

Expand Down
6 changes: 3 additions & 3 deletions azurerm/resource_arm_app_service.go
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ func resourceArmAppServiceCreate(d *schema.ResourceData, meta interface{}) error
SiteAuthSettingsProperties: &authSettings}

if _, err := client.UpdateAuthSettings(ctx, resGroup, name, auth); err != nil {
return err
return fmt.Errorf("Error updating auth settings for App Service %q (Resource Group %q): %+s", name, resGroup, err)
}

return resourceArmAppServiceUpdate(d, meta)
Expand Down Expand Up @@ -462,7 +462,7 @@ func resourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error {

authResp, err := client.GetAuthSettings(ctx, resGroup, name)
if err != nil {
return fmt.Errorf("Error making Read request on AzureRM App Service AuthSettings %q: %+v", name, err)
return fmt.Errorf("Error retrieving the AuthSettings for App Service %q (Resource Group %q): %+v", name, resGroup, err)
}

appSettingsResp, err := client.ListApplicationSettings(ctx, resGroup, name)
Expand Down Expand Up @@ -530,7 +530,7 @@ func resourceArmAppServiceRead(d *schema.ResourceData, meta interface{}) error {

authSettings := azure.FlattenAppServiceAuthSettings(authResp.SiteAuthSettingsProperties)
if err := d.Set("auth_settings", authSettings); err != nil {
return err
return fmt.Errorf("Error setting `auth_settings`: %+s", err)
}

scm := flattenAppServiceSourceControl(scmResp.SiteSourceControlProperties)
Expand Down

0 comments on commit cb8d8c1

Please sign in to comment.