Commit 9cbcb1be authored by Hrvoje Ribicic's avatar Hrvoje Ribicic

Fix job error message after unclean master shutdown

According to commit 599ee321, any job-related error messages should
be encoded within a Ganeti-specific error and not passed on as a
string, to allow for easier parsing.

For jobs suffering from an undesirable status after an unclean master
daemon shutdown, the message was not encoded, as reported in issue 618.
This patch fixes the problem.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarHelga Velroyen <helgav@google.com>
parent 77b0d264
......@@ -1756,8 +1756,9 @@ class JobQueue(object):
job.MarkUnfinishedOps(constants.OP_STATUS_QUEUED, None)
restartjobs.append(job)
else:
to_encode = errors.OpExecError("Unclean master daemon shutdown")
job.MarkUnfinishedOps(constants.OP_STATUS_ERROR,
"Unclean master daemon shutdown")
_EncodeOpError(to_encode))
job.Finalize()
self.UpdateJobUnlocked(job)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment