Revision 21a15682 lib/cmdlib.py
b/lib/cmdlib.py | ||
---|---|---|
1489 | 1489 |
|
1490 | 1490 |
""" |
1491 | 1491 |
_OP_REQP = ["nodes", "output_fields"] |
1492 |
REQ_BGL = False |
|
1493 |
|
|
1494 |
def ExpandNames(self): |
|
1495 |
_CheckOutputFields(static=["node"], |
|
1496 |
dynamic=["phys", "vg", "name", "size", "instance"], |
|
1497 |
selected=self.op.output_fields) |
|
1498 |
|
|
1499 |
self.needed_locks = {} |
|
1500 |
self.share_locks[locking.LEVEL_NODE] = 1 |
|
1501 |
if not self.op.nodes: |
|
1502 |
self.needed_locks[locking.LEVEL_NODE] = None |
|
1503 |
else: |
|
1504 |
self.needed_locks[locking.LEVEL_NODE] = \ |
|
1505 |
_GetWantedNodes(self, self.op.nodes) |
|
1492 | 1506 |
|
1493 | 1507 |
def CheckPrereq(self): |
1494 | 1508 |
"""Check prerequisites. |
... | ... | |
1496 | 1510 |
This checks that the fields required are valid output fields. |
1497 | 1511 |
|
1498 | 1512 |
""" |
1499 |
self.nodes = _GetWantedNodes(self, self.op.nodes) |
|
1500 |
|
|
1501 |
_CheckOutputFields(static=["node"], |
|
1502 |
dynamic=["phys", "vg", "name", "size", "instance"], |
|
1503 |
selected=self.op.output_fields) |
|
1504 |
|
|
1513 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE] |
|
1505 | 1514 |
|
1506 | 1515 |
def Exec(self, feedback_fn): |
1507 | 1516 |
"""Computes the list of nodes and their attributes. |
... | ... | |
4464 | 4473 |
|
4465 | 4474 |
""" |
4466 | 4475 |
_OP_REQP = ['nodes'] |
4476 |
REQ_BGL = False |
|
4477 |
|
|
4478 |
def ExpandNames(self): |
|
4479 |
self.needed_locks = {} |
|
4480 |
self.share_locks[locking.LEVEL_NODE] = 1 |
|
4481 |
if not self.op.nodes: |
|
4482 |
self.needed_locks[locking.LEVEL_NODE] = None |
|
4483 |
else: |
|
4484 |
self.needed_locks[locking.LEVEL_NODE] = \ |
|
4485 |
_GetWantedNodes(self, self.op.nodes) |
|
4467 | 4486 |
|
4468 | 4487 |
def CheckPrereq(self): |
4469 |
"""Check that the nodelist contains only existing nodes.
|
|
4488 |
"""Check prerequisites.
|
|
4470 | 4489 |
|
4471 | 4490 |
""" |
4472 |
self.nodes = _GetWantedNodes(self, getattr(self.op, "nodes", None))
|
|
4491 |
self.nodes = self.acquired_locks[locking.LEVEL_NODE]
|
|
4473 | 4492 |
|
4474 | 4493 |
def Exec(self, feedback_fn): |
4475 | 4494 |
"""Compute the list of all the exported system images. |
Also available in: Unified diff