From 4008c8edae31a3971fa8c4b200238afc8005d3d4 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Thu, 9 Sep 2010 18:17:25 +0200
Subject: [PATCH] =?UTF-8?q?jqueue:=20Resume=20jobs=20from=20=E2=80=9Cwaitl?=
 =?UTF-8?q?ock=E2=80=9D=20status?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

After an unclean restart of ganeti-masterd, jobs in the β€œwaitlock” status can
be safely restarted. They hadn't modified the cluster yet.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: RenΓ© Nussbaumer <rn@google.com>
---
 lib/jqueue.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/jqueue.py b/lib/jqueue.py
index bd4d98625..fe61c22ee 100644
--- a/lib/jqueue.py
+++ b/lib/jqueue.py
@@ -945,11 +945,11 @@ class JobQueue(object):
 
       status = job.CalcStatus()
 
-      if status in (constants.JOB_STATUS_QUEUED, ):
+      if status in (constants.JOB_STATUS_QUEUED,
+                    constants.JOB_STATUS_WAITLOCK):
         self._wpool.AddTask((job, ))
 
       elif status in (constants.JOB_STATUS_RUNNING,
-                      constants.JOB_STATUS_WAITLOCK,
                       constants.JOB_STATUS_CANCELING):
         logging.warning("Unfinished job %s found: %s", job.id, job)
         job.MarkUnfinishedOps(constants.OP_STATUS_ERROR,
-- 
GitLab