Fixes terraform crash when using SSH keys with Azure VMs (#6766)

This commit is contained in:
Maxime Bury 2016-05-19 16:45:58 +01:00 committed by Paul Stack
parent 427f73b10f
commit bd073c539e
1 changed files with 6 additions and 2 deletions

View File

@ -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)