Revision 04df3c7c lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
3426 | 3426 |
REG_BGL = False |
3427 | 3427 |
_SKIP_MASTER = (constants.OOB_POWER_OFF, constants.OOB_POWER_CYCLE) |
3428 | 3428 |
|
3429 |
def ExpandNames(self): |
|
3430 |
"""Gather locks we need. |
|
3431 |
|
|
3432 |
""" |
|
3433 |
if self.op.node_names: |
|
3434 |
self.op.node_names = _GetWantedNodes(self, self.op.node_names) |
|
3435 |
lock_names = self.op.node_names |
|
3436 |
else: |
|
3437 |
lock_names = locking.ALL_SET |
|
3438 |
|
|
3439 |
self.needed_locks = { |
|
3440 |
locking.LEVEL_NODE: lock_names, |
|
3441 |
} |
|
3442 |
|
|
3429 | 3443 |
def CheckPrereq(self): |
3430 | 3444 |
"""Check prerequisites. |
3431 | 3445 |
|
... | ... | |
3482 | 3496 |
" not marked offline") % node_name, |
3483 | 3497 |
errors.ECODE_STATE) |
3484 | 3498 |
|
3485 |
def ExpandNames(self): |
|
3486 |
"""Gather locks we need. |
|
3487 |
|
|
3488 |
""" |
|
3489 |
if self.op.node_names: |
|
3490 |
self.op.node_names = _GetWantedNodes(self, self.op.node_names) |
|
3491 |
lock_names = self.op.node_names |
|
3492 |
else: |
|
3493 |
lock_names = locking.ALL_SET |
|
3494 |
|
|
3495 |
self.needed_locks = { |
|
3496 |
locking.LEVEL_NODE: lock_names, |
|
3497 |
} |
|
3498 |
|
|
3499 | 3499 |
def Exec(self, feedback_fn): |
3500 | 3500 |
"""Execute OOB and return result if we expect any. |
3501 | 3501 |
|
... | ... | |
3503 | 3503 |
master_node = self.master_node |
3504 | 3504 |
ret = [] |
3505 | 3505 |
|
3506 |
for idx, node in enumerate(self.nodes): |
|
3506 |
for idx, node in enumerate(utils.NiceSort(self.nodes, |
|
3507 |
key=lambda node: node.name)): |
|
3507 | 3508 |
node_entry = [(constants.RS_NORMAL, node.name)] |
3508 | 3509 |
ret.append(node_entry) |
3509 | 3510 |
|
Also available in: Unified diff