Merge pull request #9390 from jhawk28/bug_8766

use datacenter inventory path for find folder
This commit is contained in:
Megan Marsh 2020-06-10 10:52:17 -07:00 committed by GitHub
commit dc14e6a1e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -2,6 +2,7 @@ package driver
import (
"fmt"
"path"
"github.com/vmware/govmomi/object"
"github.com/vmware/govmomi/vim25/mo"
@ -21,12 +22,7 @@ func (d *Driver) NewFolder(ref *types.ManagedObjectReference) *Folder {
}
func (d *Driver) FindFolder(name string) (*Folder, error) {
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))
f, err := d.finder.Folder(d.ctx, path.Join(d.datacenter.InventoryPath, "vm", name))
if err != nil {
return nil, err
}