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 <[email protected]>
---
 lib/jqueue.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/lib/jqueue.py b/lib/jqueue.py
index 3cf3b42..d5ea3cb 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
 
-- 
1.7.6

Reply via email to