use datacenter inventory path for find folder

This commit is contained in:
Joshua Foster 2020-06-10 08:24:23 -04:00
parent 46aea0f14b
commit c7a6315ca4
1 changed files with 1 additions and 6 deletions

View File

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