Skip to content

Commit

Permalink
r/vpn_server_configuration: fixing the linting
Browse files Browse the repository at this point in the history
  • Loading branch information
tombuildsstuff committed Nov 28, 2019
1 parent e006810 commit 2f1bee7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions azurerm/resource_arm_vpn_server_configuration.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func resourceArmVPNServerConfiguration() *schema.Resource {
"location": azure.SchemaLocation(),

"vpn_authentication_types": {
Type: schema.TypeSet,
Type: schema.TypeList,
Required: true,
Elem: &schema.Schema{
Type: schema.TypeString,
Expand Down Expand Up @@ -349,23 +349,20 @@ func resourceArmVPNServerConfigurationCreateUpdate(d *schema.ResourceData, meta
supportsCertificates := false
supportsRadius := false

vpnAuthenticationTypesRaw := d.Get("vpn_authentication_types").(*schema.Set).List()
vpnAuthenticationTypesRaw := d.Get("vpn_authentication_types").([]interface{})
vpnAuthenticationTypes := make([]network.VpnAuthenticationType, 0)
for _, v := range vpnAuthenticationTypesRaw {
authType := network.VpnAuthenticationType(v.(string))

switch authType {
case network.AAD:
supportsAAD = true
break

case network.Certificate:
supportsCertificates = true
break

case network.Radius:
supportsRadius = true
break

default:
return fmt.Errorf("Unsupported `vpn_authentication_type`: %q", authType)
Expand Down Expand Up @@ -492,7 +489,7 @@ func resourceArmVPNServerConfigurationRead(d *schema.ResourceData, meta interfac
vpnAuthenticationTypes = append(vpnAuthenticationTypes, string(v))
}
}
if err := d.Set("vpn_authentication_types", schema.NewSet(schema.HashString, vpnAuthenticationTypes)); err != nil {
if err := d.Set("vpn_authentication_types", vpnAuthenticationTypes); err != nil {
return fmt.Errorf("Error setting `vpn_authentication_types`: %+v", err)
}

Expand Down

0 comments on commit 2f1bee7

Please sign in to comment.