def _CheckFileStoragePath(path, allowed, exact_match_ok=False):
  if not os.path.isabs(path):
    raise errors.FileStoragePathError("File storage path must be absolute,"
                                      " got '%s'" % path)

  for i in allowed:
    if not os.path.isabs(i):
      logging.info("Ignoring relative path '%s' for file storage", i)
      continue

    if exact_match_ok:
      if os.path.normpath(i) == os.path.normpath(path):
        break

    if utils.IsBelowDir(i, path):
      break
  else:
    raise errors.FileStoragePathError("Path '%s' is not acceptable for file"
                                      " storage" % path)
Checks if a path is in a list of allowed paths for file storage.
dataset/ETHPy150Open ganeti/ganeti/lib/storage/filestorage.py/_CheckFileStoragePath