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.
This commit is contained in:
Brandon Heller 2015-06-04 02:43:16 -07:00
parent 3a066d53d3
commit a7eeb6a6a7
1 changed files with 2 additions and 2 deletions

View File

@ -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 {