Commit fbe9022f authored by Guido Trotter's avatar Guido Trotter
Browse files

Convert LUTestDelay to concurrent usage

In order to do so:
  - We set REQ_BGL to False
  - We implement ExpandNames

That's it, really.

Reviewed-by: iustinp
parent 68adfdb2
......@@ -4606,17 +4606,26 @@ class LUTestDelay(NoHooksLU):
_OP_REQP = ["duration", "on_master", "on_nodes"]
REQ_BGL = False
def CheckPrereq(self):
"""Check prerequisites.
def ExpandNames(self):
"""Expand names and set required locks.
This checks that we have a good list of nodes and/or the duration
is valid.
This expands the node list, if any.
self.needed_locks = {}
if self.op.on_nodes:
# _GetWantedNodes can be used here, but is not always appropriate to use
# this way in ExpandNames. Check LogicalUnit.ExpandNames docstring for
# more information.
self.op.on_nodes = _GetWantedNodes(self, self.op.on_nodes)
self.needed_locks[locking.LEVEL_NODE] = self.op.on_nodes
def CheckPrereq(self):
"""Check prerequisites.
def Exec(self, feedback_fn):
"""Do the actual sleep.
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