mirror of
https://github.com/bpg/terraform-provider-proxmox.git
synced 2025-06-30 18:42:58 +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
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
2
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -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
|
||||
|
@ -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