Revision 91c622a8 lib/cli.py

b/lib/cli.py
1688 1688
  elif isinstance(err, luxi.ProtocolError):
1689 1689
    obuf.write("Unhandled protocol error while talking to the master daemon:\n"
1690 1690
               "%s" % msg)
1691
  elif isinstance(err, errors.JobLost):
1692
    obuf.write("Error checking job status: %s" % msg)
1691 1693
  elif isinstance(err, errors.GenericError):
1692 1694
    obuf.write("Unhandled Ganeti error: %s" % msg)
1693 1695
  elif isinstance(err, JobSubmittedException):
......
2326 2328
    assert result
2327 2329

  
2328 2330
    for job_data, status in zip(self.jobs, result):
2329
      if status[0] in (constants.JOB_STATUS_QUEUED,
2330
                    constants.JOB_STATUS_WAITLOCK,
2331
                    constants.JOB_STATUS_CANCELING):
2332
        # job is still waiting
2331
      if (isinstance(status, list) and status and
2332
          status[0] in (constants.JOB_STATUS_QUEUED,
2333
                        constants.JOB_STATUS_WAITLOCK,
2334
                        constants.JOB_STATUS_CANCELING)):
2335
        # job is still present and waiting
2333 2336
        continue
2334
      # good candidate found
2337
      # good candidate found (either running job or lost job)
2335 2338
      self.jobs.remove(job_data)
2336 2339
      return job_data
2337 2340

  
......
2367 2370
      try:
2368 2371
        job_result = PollJob(jid, cl=self.cl, feedback_fn=self.feedback_fn)
2369 2372
        success = True
2373
      except errors.JobLost, err:
2374
        _, job_result = FormatError(err)
2375
        ToStderr("Job %s for %s has been archived, cannot check its result",
2376
                 jid, name)
2377
        success = False
2370 2378
      except (errors.GenericError, luxi.ProtocolError), err:
2371 2379
        _, job_result = FormatError(err)
2372 2380
        success = False

Also available in: Unified diff