use the Datacenter's VmFolder instead of hand generating it
This commit is contained in:
parent
374f82b978
commit
30bff17799
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue