Commit e5d8774b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Add job priority constants


Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e4ef4343
......@@ -841,6 +841,16 @@ OPS_FINALIZED = frozenset([OP_STATUS_CANCELED,
OP_STATUS_SUCCESS,
OP_STATUS_ERROR])
# OpCode priority
OP_PRIO_LOWEST = +19
OP_PRIO_HIGHEST = -20
OP_PRIO_LOW = +10
OP_PRIO_NORMAL = 0
OP_PRIO_HIGH = -10
OP_PRIO_DEFAULT = OP_PRIO_NORMAL
# Execution log types
ELOG_MESSAGE = "message"
ELOG_PROGRESS = "progress"
......
......@@ -26,6 +26,7 @@ import unittest
import re
from ganeti import constants
from ganeti import locking
import testutils
......@@ -68,6 +69,14 @@ class TestConstants(unittest.TestCase):
self.failUnless(constants.SSL_CERT_EXPIRATION_ERROR <
constants.SSL_CERT_EXPIRATION_WARN)
def testOpCodePriority(self):
self.failUnless(constants.OP_PRIO_LOWEST > constants.OP_PRIO_LOW)
self.failUnless(constants.OP_PRIO_LOW > constants.OP_PRIO_NORMAL)
self.failUnlessEqual(constants.OP_PRIO_NORMAL, locking._DEFAULT_PRIORITY)
self.failUnlessEqual(constants.OP_PRIO_DEFAULT, locking._DEFAULT_PRIORITY)
self.failUnless(constants.OP_PRIO_NORMAL > constants.OP_PRIO_HIGH)
self.failUnless(constants.OP_PRIO_HIGH > constants.OP_PRIO_HIGHEST)
class TestParameterNames(unittest.TestCase):
"""HV/BE parameter tests"""
......
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