def get_sub_folders(session, ds_browser, ds_path):
 search_task = session._call_method(session.vim, 'SearchDatastore_Task', ds_browser, datastorePath=str(ds_path))
 try:
  task_info = session._wait_for_task(search_task)
 except vexc.FileNotFoundException:
  return set()
 if hasattr(task_info.result, 'file'):
  return set([file.path for file in task_info.result.file])
 return set()

def get_sub_folders ( session , ds_browser , ds_path ) : search_task = session . _call_method ( session . vim , 'SearchDatastore_Task' , ds_browser , datastorePath = str ( ds_path ) ) try : task_info = session . _wait_for_task ( search_task ) except vexc . FileNotFoundException : return set ( ) if hasattr ( task_info . result , 'file' ) : return set ( [ file . path for file in task_info . result . file ] ) return set ( )
return a set of subfolders for a path on a datastore .