Merge pull request #9542 from jhawk28/bug_9511

clean up folder path so that it is what vsphere expects
pull/9563/head
Megan Marsh 6 years ago committed by GitHub
commit 61b79b6e53
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,7 +3,11 @@
package common
import "fmt"
import (
"fmt"
"path"
"strings"
)
type LocationConfig struct {
// Name of the new VM to create.
@ -38,5 +42,9 @@ func (c *LocationConfig) Prepare() []error {
errs = append(errs, fmt.Errorf("'host' or 'cluster' is required"))
}
// clean Folder path and remove leading slash as folders are relative within vsphere
c.Folder = path.Clean(c.Folder)
c.Folder = strings.TrimLeft(c.Folder, "/")
return errs
}

Loading…
Cancel
Save