From 18c5e8deb824fd8d6e35c59d14616205e0e57ddf Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 19 Oct 2018 13:46:55 -0700 Subject: [PATCH] fix --- builder/vmware/iso/driver_esx5.go | 6 ------ communicator/ssh/communicator.go | 4 ++-- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index 803d797b4..6a98d3399 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -89,18 +89,13 @@ 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 } @@ -590,7 +585,6 @@ 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() diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index ebeacfeab..3c2fd0490 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -563,8 +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) + // Escape spaces in remote directory + target_dir = strings.Replace(target_dir, " ", "\\ ", -1) // On windows, filepath.Dir uses backslash separators (ie. "\tmp"). // This does not work when the target host is unix. Switch to forward slash