0
0
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:
Pavel Boldyrev 2023-04-07 22:38:07 -04:00 committed by GitHub
parent 401b39782f
commit be3995e969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 2 deletions

View File

@ -3,7 +3,7 @@ Please mark the following items with an [x] if they apply to your PR.
Leave the [ ] if they are not applicable, or if you have not completed the item.
- [ ] I have added / updated documentation in `/docs` for any user-facing features or additions.
- [ ] I have added / updated templates in `/examples` for any new or updated resources / data sources.
- [ ] I have ran `make examples` to verify that the change works as expected.
- [ ] I have ran `make examples` to verify that the change works as expected.
<!--- Please keep this note for the community --->
### Community Note

View File

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