From 6dc858e6cfed6adc9022e3eafb5add612802882d Mon Sep 17 00:00:00 2001 From: Yuya Kusakabe Date: Fri, 9 May 2014 13:16:18 +0900 Subject: [PATCH] Fixes #1062, ESXi Driver supports PACKER_CACHE_DIR --- builder/vmware/iso/driver_esx5.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index 2e9375859..cf9ca9dbf 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -260,10 +260,8 @@ func (d *ESX5Driver) String() string { } func (d *ESX5Driver) datastorePath(path string) string { - if filepath.IsAbs(path) { - return filepath.Join("/vmfs/volumes", d.Datastore, strings.Replace(path, "/", "", 1)) - } - return filepath.Join("/vmfs/volumes", d.Datastore, path) + baseDir := filepath.Base(filepath.Dir(path)) + return filepath.Join("/vmfs/volumes", d.Datastore, baseDir, filepath.Base(path)) } func (d *ESX5Driver) connect() error {