def CreateTasksFilter(pc, tasks):
 if (not tasks):
  return None
 objspecs = [vmodl.query.PropertyCollector.ObjectSpec(obj=task) for task in tasks]
 propspec = vmodl.query.PropertyCollector.PropertySpec(type=vim.Task, pathSet=[], all=True)
 filterspec = vmodl.query.PropertyCollector.FilterSpec()
 filterspec.objectSet = objspecs
 filterspec.propSet = [propspec]
 return pc.CreateFilter(filterspec, True)

def CreateTasksFilter ( pc , tasks ) : if ( not tasks ) : return None objspecs = [ vmodl . query . PropertyCollector . ObjectSpec ( obj = task ) for task in tasks ] propspec = vmodl . query . PropertyCollector . PropertySpec ( type = vim . Task , pathSet = [ ] , all = True ) filterspec = vmodl . query . PropertyCollector . FilterSpec ( ) filterspec . objectSet = objspecs filterspec . propSet = [ propspec ] return pc . CreateFilter ( filterspec , True )
create property collector filter for tasks .