use strconv.unquote instead of DIY
This commit is contained in:
parent
5980d32efb
commit
bbd64896a0
|
@ -201,7 +201,7 @@ func (d *Vagrant_2_2_Driver) vagrantCmd(args ...string) (string, string, error)
|
|||
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("Error starting vagrant command with args: %s",
|
||||
return "", "", fmt.Errorf("Error starting vagrant command with args: %q",
|
||||
strings.Join(args, " "))
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ import (
|
|||
"context"
|
||||
"log"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
)
|
||||
|
@ -57,12 +56,9 @@ func (s *StepSSHConfig) Run(ctx context.Context, state multistep.StateBag) multi
|
|||
}
|
||||
log.Printf("identity file is %s", sshConfig.IdentityFile)
|
||||
log.Printf("Removing quotes from identity file")
|
||||
if strings.HasPrefix(sshConfig.IdentityFile, "\"") {
|
||||
sshConfig.IdentityFile = sshConfig.IdentityFile[1:]
|
||||
if strings.HasSuffix(sshConfig.IdentityFile, "\"") {
|
||||
sshConfig.IdentityFile = sshConfig.IdentityFile[:len(sshConfig.IdentityFile)-1]
|
||||
}
|
||||
log.Printf("identity file is now %s", sshConfig.IdentityFile)
|
||||
sshConfig.IdentityFile, err = strconv.Unquote(sshConfig.IdentityFile)
|
||||
if err != nil {
|
||||
log.Printf("Error unquoting identity file: %s", err)
|
||||
}
|
||||
config.Comm.SSHPrivateKeyFile = sshConfig.IdentityFile
|
||||
config.Comm.SSHUsername = sshConfig.User
|
||||
|
|
Loading…
Reference in New Issue