From 2503f8a4ba365e9cab1da71c34fed9fe15903d62 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Mon, 11 Nov 2013 15:51:30 -0800 Subject: [PATCH] builder/vmware: Path related fixes in esx5 driver - Fix mkdir of packer_cache in ESX5Driver.UploadISO - Fix vmx path in ESX5Driver.IsRunning --- builder/vmware/driver_esx5.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/builder/vmware/driver_esx5.go b/builder/vmware/driver_esx5.go index 92fca7f3c..cdf8df3bf 100644 --- a/builder/vmware/driver_esx5.go +++ b/builder/vmware/driver_esx5.go @@ -42,7 +42,7 @@ func (d *ESX5Driver) CreateDisk(diskPathLocal string, size string, typeId string } func (d *ESX5Driver) IsRunning(vmxPathLocal string) (bool, error) { - vmxPath := d.datastorePath(vmxPathLocal) + vmxPath := filepath.Join(d.outputDir, filepath.Base(vmxPathLocal)) state, err := d.run(nil, "vim-cmd", "vmsvc/power.getstate", vmxPath) if err != nil { return false, err @@ -84,11 +84,11 @@ func (d *ESX5Driver) UploadISO(localPath string) (string, error) { return "", err } - if err := d.mkdir(filepath.Dir(targetFile)); err != nil { + finalPath := d.datastorePath(targetFile) + if err := d.mkdir(filepath.Dir(finalPath)); err != nil { return "", err } - finalPath := d.datastorePath(targetFile) if err := d.upload(finalPath, localPath); err != nil { return "", err }