vmware / pyvmomi-community-samples

A place for community contributed samples for the pyVmomi library.
Apache License 2.0
1.01k stars 922 forks source link

List empty directories in a datastore #721

Open zdxerr opened 1 year ago

zdxerr commented 1 year ago

Describe the bug

I tried to list all all empty directories on a datastore but was not successful with

search_spec = vim.host.DatastoreBrowser.SearchSpec(query=[vim.host.DatastoreBrowser.FolderQuery()])
datastore.browser.SearchDatastoreSubFolders_Task(f"[{datastore.summary.name}]", search_spec)

Only directories like scratch are listed. What can I do about this?

Reproduction steps

1. 2. 3. ...

Expected behavior

List all directories including empty ones, and ones containing vm specific files.

Additional context

No response