Fixes terraform crash when using SSH keys with Azure VMs (#6766)
This commit is contained in:
parent
427f73b10f
commit
bd073c539e
|
@ -927,9 +927,13 @@ func expandAzureRmVirtualMachineOsProfileLinuxConfig(d *schema.ResourceData) (*c
|
|||
}
|
||||
|
||||
linuxKeys := linuxConfig["ssh_keys"].([]interface{})
|
||||
sshPublicKeys := make([]compute.SSHPublicKey, 0, len(linuxKeys))
|
||||
sshPublicKeys := []compute.SSHPublicKey{}
|
||||
for _, key := range linuxKeys {
|
||||
sshKey := key.(map[string]interface{})
|
||||
|
||||
sshKey, ok := key.(map[string]interface{})
|
||||
if !ok {
|
||||
continue
|
||||
}
|
||||
path := sshKey["path"].(string)
|
||||
keyData := sshKey["key_data"].(string)
|
||||
|
||||
|
|
Loading…
Reference in New Issue