Skip to content

Commit

Permalink
Set the InventoryPath of the folder object in DefaultFolder (#1515)
Browse files Browse the repository at this point in the history
* Set the InventoryPath of the folder object in DefaultFolder
  • Loading branch information
ykakarap authored and dougm committed Jul 3, 2019
1 parent c57f61e commit 35d0b7d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions find/finder.go
Original file line number Diff line number Diff line change
Expand Up @@ -916,6 +916,12 @@ func (f *Finder) DefaultFolder(ctx context.Context) (*object.Folder, error) {
}
folder := object.NewFolder(f.client, ref.Reference())

// Set the InventoryPath of the newly created folder object
// The default foler becomes the datacenter's "vm" folder.
// The "vm" folder always exists for a datacenter. It cannot be
// removed or replaced
folder.SetInventoryPath(path.Join(f.dc.InventoryPath, "vm"))

return folder, nil
}

Expand Down

0 comments on commit 35d0b7d

Please sign in to comment.