def LockSudoers(self):
    """Create an advisory lock on /etc/sudoers.tmp.

    Returns:
      True if successful, False if not.
    """
    try:
      f = self.os.open('/etc/sudoers.tmp', os.O_EXCL|os.O_CREAT)
      self.os.close(f)
      return True
    except __HOLE__ as e:
      if e.errno == errno.EEXIST:
        logging.warning('/etc/sudoers.tmp lock file already exists')
      else:
        logging.warning('Could not create /etc/sudoers.tmp lock file: %s', e)
    return False
dataset/ETHPy150Open GoogleCloudPlatform/compute-image-packages/google-daemon/usr/share/google/google_daemon/accounts.py/Accounts.LockSudoers