use ssh.ParsePrivateKey where we can

This commit is contained in:
Adrien Delorme 2018-08-22 18:16:40 +02:00
parent bacfb02182
commit fa44a4546f
2 changed files with 2 additions and 3 deletions

View File

@ -15,7 +15,6 @@ import (
"time"
vmwcommon "github.com/hashicorp/packer/builder/vmware/common"
commonssh "github.com/hashicorp/packer/common/ssh"
"github.com/hashicorp/packer/communicator/ssh"
"github.com/hashicorp/packer/helper/multistep"
"github.com/hashicorp/packer/packer"
@ -515,7 +514,7 @@ func (d *ESX5Driver) connect() error {
}
if d.PrivateKey != "" {
signer, err := commonssh.FileSigner(d.PrivateKey)
signer, err := gossh.ParsePrivateKey([]byte(d.PrivateKey))
if err != nil {
return err
}

View File

@ -225,7 +225,7 @@ func sshBastionConfig(config *Config) (*gossh.ClientConfig, error) {
}
if config.SSHBastionPrivateKey != "" {
signer, err := commonssh.FileSigner(config.SSHBastionPrivateKey)
signer, err := gossh.ParsePrivateKey([]byte(config.SSHBastionPrivateKey))
if err != nil {
return nil, err
}