Merge pull request #9342 from jhawk28/bug_9328

(vsphere-iso) use the Datacenter's VmFolder
This commit is contained in:
Megan Marsh 2020-06-02 10:24:48 -07:00 committed by GitHub
commit e851757e5f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 1 deletions

View File

@ -21,7 +21,12 @@ func (d *Driver) NewFolder(ref *types.ManagedObjectReference) *Folder {
}
func (d *Driver) FindFolder(name string) (*Folder, error) {
f, err := d.finder.Folder(d.ctx, fmt.Sprintf("/%v/vm/%v", d.datacenter.Name(), name))
folders, err := d.datacenter.Folders(d.ctx)
if err != nil {
return nil, err
}
f, err := d.finder.Folder(d.ctx, fmt.Sprintf("%v/%v", folders.VmFolder.InventoryPath, name))
if err != nil {
return nil, err
}