Merge pull request #8605 from hashicorp/fix_8599
remove unhelpful quotes to fix bug with reading key from a path with …
This commit is contained in:
commit
b8edaa9850
|
@ -199,7 +199,11 @@ func (d *Vagrant_2_2_Driver) vagrantCmd(args ...string) (string, string, error)
|
|||
cmd.Stdout = &stdout
|
||||
cmd.Stderr = &stderr
|
||||
|
||||
cmd.Start()
|
||||
err := cmd.Start()
|
||||
if err != nil {
|
||||
return "", "", fmt.Errorf("Error starting vagrant command with args: %q",
|
||||
strings.Join(args, " "))
|
||||
}
|
||||
|
||||
stdoutString := ""
|
||||
stderrString := ""
|
||||
|
@ -238,7 +242,7 @@ func (d *Vagrant_2_2_Driver) vagrantCmd(args ...string) (string, string, error)
|
|||
}
|
||||
}()
|
||||
|
||||
err := cmd.Wait()
|
||||
err = cmd.Wait()
|
||||
|
||||
donech <- true
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@ package vagrant
|
|||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/packer/helper/multistep"
|
||||
|
@ -53,6 +54,12 @@ func (s *StepSSHConfig) Run(ctx context.Context, state multistep.StateBag) multi
|
|||
// auth provided there.
|
||||
return multistep.ActionContinue
|
||||
}
|
||||
log.Printf("identity file is %s", sshConfig.IdentityFile)
|
||||
log.Printf("Removing quotes from identity file")
|
||||
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