'make a /vm/foo/bar/baz like folder path for an object'

def compile_folder_path_for_object(self, vobj):

    paths = []
    if isinstance(vobj, vim.Folder):
        paths.append(vobj.name)
    thisobj = vobj
    while hasattr(thisobj, 'parent'):
        thisobj = thisobj.parent
        if isinstance(thisobj, vim.Folder):
            paths.append(thisobj.name)
    paths.reverse()
    if (paths[0] == 'Datacenters'):
        paths.remove('Datacenters')
    return ('/' + '/'.join(paths))
