From 1e4133cbf92299c867c7e211cb4b285590070e4a Mon Sep 17 00:00:00 2001 From: Megan Marsh Date: Fri, 12 Oct 2018 13:33:42 -0700 Subject: [PATCH] quote upload path --- builder/vmware/iso/driver_esx5.go | 6 ++++++ communicator/ssh/communicator.go | 2 ++ 2 files changed, 8 insertions(+) diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index 6a98d3399..803d797b4 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -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() diff --git a/communicator/ssh/communicator.go b/communicator/ssh/communicator.go index 8fbddc968..ebeacfeab 100644 --- a/communicator/ssh/communicator.go +++ b/communicator/ssh/communicator.go @@ -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