def _LoadJobUnlocked(self, job_id):
    assert isinstance(job_id, int), "Job queue: Supplied job id is not an int!"

    job = self._memcache.get(job_id, None)
    if job:
      logging.debug("Found job %s in memcache", job_id)
      assert job.writable, "Found read-only job in memcache"
      return job

    try:
      job = JobQueue._LoadJobFromDisk(self, job_id, False)
      if job is None:
        return job
    except errors.JobFileCorrupted:
      old_path = self._GetJobPath(job_id)
      new_path = self._GetArchivedJobPath(job_id)
      if old_path == new_path:
        # job already archived (future case)
        logging.exception("Can't parse job %s", job_id)
      else:
        # non-archived case
        logging.exception("Can't parse job %s, will archive.", job_id)
        self._RenameFilesUnlocked([(old_path, new_path)])
      return None

    assert job.writable, "Job just loaded is not writable"

    self._memcache[job_id] = job
    logging.debug("Added job %s to the cache", job_id)
    return job
Tests the NewFileSystem function.
dataset/ETHPy150Open ganeti/ganeti/lib/jqueue/__init__.py/JobQueue._LoadJobUnlocked--crossover with--dataset/ETHPy150Open log2timeline/dfvfs/tests/resolver/gzip_resolver_helper.py/GzipResolverHelperTest.testNewFileSystem