quote upload path

pull/6891/head
Megan Marsh 7 years ago
parent 3f591d78f3
commit 1e4133cbf9

@ -89,13 +89,18 @@ func (d *ESX5Driver) Stop(vmxPathLocal string) error {
func (d *ESX5Driver) Register(vmxPathLocal string) error {
vmxPath := filepath.ToSlash(filepath.Join(d.outputDir, filepath.Base(vmxPathLocal)))
log.Printf("DEBUGGING 6794 (1): upload path is: %s", vmxPath)
if err := d.upload(vmxPath, vmxPathLocal); err != nil {
log.Printf("DEBUGGING 6794 (2): upload errored: %s", err.Error())
return err
}
log.Printf("DEBUGGING 6794 (3): Upload succeeded")
r, err := d.run(nil, "vim-cmd", "solo/registervm", fmt.Sprintf("\"%s\"", vmxPath))
if err != nil {
log.Printf("DEBUGGING 6794 (4): VM registration errorred: %s", err.Error())
return err
}
log.Printf("DEBUGGING 6794 (5): Registration succeeded")
d.vmId = strings.TrimRight(r, "\n")
return nil
}
@ -585,6 +590,7 @@ func (d *ESX5Driver) mkdir(path string) error {
func (d *ESX5Driver) upload(dst, src string) error {
f, err := os.Open(src)
if err != nil {
log.Printf("DEBUGGING 6794 (6): unable to open src file for scp upload")
return err
}
defer f.Close()

@ -563,6 +563,8 @@ func (c *comm) scpUploadSession(path string, input io.Reader, fi *os.FileInfo) e
// The target directory and file for talking the SCP protocol
target_dir := filepath.Dir(path)
target_file := filepath.Base(path)
log.Printf("DEBUGGING 6794 (7): target dir is %s", target_dir)
log.Printf("DEBUGGING 6794 (8): target file is %s", target_file)
// On windows, filepath.Dir uses backslash separators (ie. "\tmp").
// This does not work when the target host is unix. Switch to forward slash

Loading…
Cancel
Save