def _lock_state_file(self): if not self.lock: return self._lockfile = lockfile.LockFile(self.path) try: self._lockfile.acquire() except IOError: raise exception.HomeDirPermissionsError(dirname(self.path))
def _lock_dbindex(self): if not self.cache_dir: os.makedirs(self.cache_dir) self._lockfile = lockfile.LockFile(self.cache_dir) try: self._lockfile.acquire() except: # pylint: disable=bare-except return False return True