def _ParsePidFileContents(data):
  """Tries to extract a process ID from a PID file's content.

  @type data: string
  @rtype: int
  @return: Zero if nothing could be read, PID otherwise

  """
  try:
    pid = int(data)
  except (TypeError, __HOLE__):
    logging.info("Can't parse pid file contents", exc_info=True)
    return 0
  else:
    return pid
dataset/ETHPy150Open ganeti/ganeti/lib/utils/io.py/_ParsePidFileContents