mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-07-01 19:12:59 +00:00
fix(core): Error when open SSH session on Windows (#293)
* fix(core): Error when open SSH session on Windows * update PR template
This commit is contained in:
parent
401b39782f
commit
be3995e969
@ -194,8 +194,12 @@ func (c *VirtualEnvironmentClient) OpenNodeShell(
|
||||
|
||||
ur := strings.Split(c.Username, "@")
|
||||
|
||||
homeDir, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to determine the home directory: %w", err)
|
||||
}
|
||||
sshHost := fmt.Sprintf("%s:22", *nodeAddress)
|
||||
khPath := fmt.Sprintf("%s/.ssh/known_hosts", os.Getenv("HOME"))
|
||||
khPath := fmt.Sprintf("%s/.ssh/known_hosts", homeDir)
|
||||
kh, err := knownhosts.New(khPath)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to read %s: %w", khPath, err)
|
||||
|
Loading…
Reference in New Issue
Block a user