Skip to content
Snippets Groups Projects
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
No related branches found
No related tags found
No related merge requests found
...@@ -841,6 +841,16 @@ OPS_FINALIZED = frozenset([OP_STATUS_CANCELED, ...@@ -841,6 +841,16 @@ OPS_FINALIZED = frozenset([OP_STATUS_CANCELED,
OP_STATUS_SUCCESS, OP_STATUS_SUCCESS,
OP_STATUS_ERROR]) 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 # Execution log types
ELOG_MESSAGE = "message" ELOG_MESSAGE = "message"
ELOG_PROGRESS = "progress" ELOG_PROGRESS = "progress"
......
...@@ -26,6 +26,7 @@ import unittest ...@@ -26,6 +26,7 @@ import unittest
import re import re
from ganeti import constants from ganeti import constants
from ganeti import locking
import testutils import testutils
...@@ -68,6 +69,14 @@ class TestConstants(unittest.TestCase): ...@@ -68,6 +69,14 @@ class TestConstants(unittest.TestCase):
self.failUnless(constants.SSL_CERT_EXPIRATION_ERROR < self.failUnless(constants.SSL_CERT_EXPIRATION_ERROR <
constants.SSL_CERT_EXPIRATION_WARN) 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): class TestParameterNames(unittest.TestCase):
"""HV/BE parameter tests""" """HV/BE parameter tests"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment