Revision a81ca843

b/src/Ganeti/HTools/Program/Hbal.hs
54 54
import Ganeti.HTools.ExtLoader
55 55
import Ganeti.HTools.Types
56 56
import Ganeti.HTools.Loader
57
import Ganeti.OpCodes (wrapOpCode, setOpComment, OpCode, MetaOpCode)
57
import Ganeti.OpCodes (wrapOpCode, setOpComment, setOpPriority,
58
                       OpCode, MetaOpCode)
58 59
import Ganeti.Jobs as Jobs
59 60
import Ganeti.Types
60 61
import Ganeti.Utils
......
93 94
    , oExTags
94 95
    , oExInst
95 96
    , oSaveCluster
97
    , oPriority
96 98
    ]
97 99

  
98 100
-- | The list of arguments supported by the program.
......
224 226
            Nothing ->
225 227
              return $ Bad "Execution of commands possible only on LUXI"
226 228
            Just master ->
227
              execWithCancel annotateOpCode master fin_nl il cmd_jobs)
229
              let annotator = maybe id setOpPriority (optPriority opts) .
230
                              annotateOpCode
231
              in execWithCancel annotator master fin_nl il cmd_jobs)
228 232
    else return $ Ok ()
229 233

  
230 234
-- | Signal handler for graceful termination.
b/test/hs/shelltests/htools-balancing.test
13 13
>>> /gnt-instance (failover|migrate|replace-disks)/
14 14
>>>= 0
15 15

  
16
# test that correct priorities are accepted
17
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -C -S $T/simu-rebal.standard --prio low
18
>>> /gnt-instance (failover|migrate|replace-disks)/
19
>>>= 0
20

  
21

  
16 22
# test that hbal won't execute rebalances when using the text backend
17 23
./test/hs/hbal $BACKEND_BAL_STD -G group-01 -X
18 24
>>>2
b/test/hs/shelltests/htools-invalid.test
57 57
>>>2
58 58
Error: Cannot create node graph
59 59
>>>=1
60

  
61
# hbal doesn't accept invalid priority
62
./test/hs/hbal --priority=abc
63
>>>2/Unknown priority/
64
>>>=1

Also available in: Unified diff