Fix a few job archival issues
authorIustin Pop <iustin@google.com>
Thu, 29 Jul 2010 23:00:19 +0000 (19:00 -0400)
committerIustin Pop <iustin@google.com>
Fri, 30 Jul 2010 01:43:50 +0000 (21:43 -0400)
commitaa9f81678bc1f68f2cf2007397ce352b674d4ba8
tree1ba09eb2f3721f408a0443e4d4b9b0559abcbe41
parent78bb78b1c5987a3135599c53e6cfc6e20a32c700
Fix a few job archival issues

This patch fixes two issues with job archival. First, the
LoadJobFromDisk can return 'None' for no-such-job, and we shouldn't add
None to the job list; we can't anyway, as this raises an exception:

  node1# gnt-job archive foo
  Unhandled protocol error while talking to the master daemon:
  Caught exception: cannot create weak reference to 'NoneType' object

After fixing this, job archival of missing jobs will just continue
silently, so we modify gnt-job archive to log jobs which were not
archived and to return exit code 1 for any missing jobs.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
lib/jqueue.py
scripts/gnt-job