def MakeVirtualPath(path, _noderoot=_VIRT_NODEROOT):
  """Virtualizes a path.

  A path is "virtualized" by stripping it of its node-specific directory and
  prepending a prefix (L{_VIRT_PATH_PREFIX}). Use L{LocalizeVirtualPath} to
  undo the process. Virtual paths are meant to be transported via RPC.

  """
  assert os.path.isabs(path), "Path not absolute: " + path

  if _noderoot and path not in _VPATH_WHITELIST:
    return _VIRT_PATH_PREFIX + _RemoveNodePrefix(path, _noderoot=_noderoot)
  else:
    return path
dataset/ETHPy150Open ganeti/ganeti/lib/vcluster.py/MakeVirtualPath/original