From 719f8fba367d1eace23bdd57c74cc7d23f1e6e74 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Thu, 27 Oct 2011 15:24:15 +0200
Subject: [PATCH] jqueue: Allow zero jobs to be submitted at once
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

If cmdlib.LUNodeMigrate was called for a node without primary instances
it would try to submit an empty list of jobs. This was never visible via
CLI as there we check the list of primary instances first.

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

diff --git a/lib/jqueue.py b/lib/jqueue.py
index 3cf3b4287..d5ea3cb79 100644
--- a/lib/jqueue.py
+++ b/lib/jqueue.py
@@ -1798,7 +1798,8 @@ class JobQueue(object):
     @return: a string representing the job identifier.
 
     """
-    assert count > 0
+    assert ht.TPositiveInt(count)
+
     # New number
     serial = self._last_serial + count
 
-- 
GitLab