From a7eeb6a6a796690af4c84d0ee6cda0abc48fbc8f Mon Sep 17 00:00:00 2001 From: Brandon Heller Date: Thu, 4 Jun 2015 02:43:16 -0700 Subject: [PATCH] vmware/iso: support hierarchical output directories When providing a hierarchical output_directory value like 'transient/jenkins-slave', the VM would fail to build in the CreateDisk step. The properly created output directory would not match the location provided to CreateDisk, since datastorePath() did not properly split such paths. Now this case works; tested hierarchical and singular output_directory values. --- builder/vmware/iso/driver_esx5.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/vmware/iso/driver_esx5.go b/builder/vmware/iso/driver_esx5.go index 2b9332760..0d6fd6531 100644 --- a/builder/vmware/iso/driver_esx5.go +++ b/builder/vmware/iso/driver_esx5.go @@ -311,8 +311,8 @@ func (d *ESX5Driver) String() string { } func (d *ESX5Driver) datastorePath(path string) string { - baseDir := filepath.Base(filepath.Dir(path)) - return filepath.ToSlash(filepath.Join("/vmfs/volumes", d.Datastore, baseDir, filepath.Base(path))) + dirPath := filepath.Dir(path) + return filepath.ToSlash(filepath.Join("/vmfs/volumes", d.Datastore, dirPath, filepath.Base(path))) } func (d *ESX5Driver) cachePath(path string) string {