'Create and return a VM inventory folder.
This method caches references to inventory folders returned.
:param datacenter: Reference to datacenter
:param path_comp: Path components as a list'

def create_vm_inventory_folder(self, datacenter, path_comp):

    LOG.debug('Creating    inventory    folder:    %(path_comp)s    under    VM    folder    of    datacenter:    %(datacenter)s.', {'path_comp': path_comp, 'datacenter': datacenter})
    path = ('/' + datacenter.value)
    parent = self._folder_cache.get(path)
    if (not parent):
        parent = self.get_vmfolder(datacenter)
        self._folder_cache[path] = parent
    folder = None
    for folder_name in path_comp:
        path = '/'.join([path, folder_name])
        folder = self._folder_cache.get(path)
        if (not folder):
            folder = self.create_folder(parent, folder_name)
            self._folder_cache[path] = folder
        parent = folder
    LOG.debug('Inventory    folder    for    path:    %(path)s    is    %(folder)s.', {'path': path, 'folder': folder})
    return folder
