Revision 85a87e21 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
9484 | 9484 |
_OP_REQP = ["duration", "on_master", "on_nodes"] |
9485 | 9485 |
REQ_BGL = False |
9486 | 9486 |
|
9487 |
def CheckArguments(self): |
|
9488 |
# TODO: convert to the type system |
|
9489 |
self.op.repeat = getattr(self.op, "repeat", 0) |
|
9490 |
if self.op.repeat < 0: |
|
9491 |
raise errors.OpPrereqError("Repetition count cannot be negative") |
|
9492 |
|
|
9487 | 9493 |
def ExpandNames(self): |
9488 | 9494 |
"""Expand names and set required locks. |
9489 | 9495 |
|
... | ... | |
9503 | 9509 |
|
9504 | 9510 |
""" |
9505 | 9511 |
|
9506 |
def Exec(self, feedback_fn):
|
|
9512 |
def _TestDelay(self):
|
|
9507 | 9513 |
"""Do the actual sleep. |
9508 | 9514 |
|
9509 | 9515 |
""" |
... | ... | |
9515 | 9521 |
for node, node_result in result.items(): |
9516 | 9522 |
node_result.Raise("Failure during rpc call to node %s" % node) |
9517 | 9523 |
|
9524 |
def Exec(self, feedback_fn): |
|
9525 |
"""Execute the test delay opcode, with the wanted repetitions. |
|
9526 |
|
|
9527 |
""" |
|
9528 |
if self.op.repeat == 0: |
|
9529 |
self._TestDelay() |
|
9530 |
else: |
|
9531 |
top_value = self.op.repeat - 1 |
|
9532 |
for i in range(self.op.repeat): |
|
9533 |
self.LogInfo("Test delay iteration %d/%d" % (i, top_value)) |
|
9534 |
self._TestDelay() |
|
9535 |
|
|
9518 | 9536 |
|
9519 | 9537 |
class IAllocator(object): |
9520 | 9538 |
"""IAllocator framework. |
Also available in: Unified diff