Revision 54c17091 lib/objects.py
b/lib/objects.py | ||
---|---|---|
537 | 537 |
# is sent to, and should not be persisted. |
538 | 538 |
["dynamic_params"]) |
539 | 539 |
|
540 |
def _ComputeAllNodes(self): |
|
541 |
"""Compute the list of all nodes covered by a device and its children.""" |
|
542 |
nodes = list() |
|
543 |
|
|
544 |
if self.dev_type in constants.DTS_DRBD: |
|
545 |
nodea, nodeb = self.logical_id[:2] |
|
546 |
nodes.append(nodea) |
|
547 |
nodes.append(nodeb) |
|
548 |
if self.children: |
|
549 |
for child in self.children: |
|
550 |
nodes.extend(child.all_nodes) |
|
551 |
|
|
552 |
return tuple(set(nodes)) |
|
553 |
|
|
554 |
all_nodes = property(_ComputeAllNodes, None, None, |
|
555 |
"List of names of all the nodes of a disk") |
|
556 |
|
|
540 | 557 |
def CreateOnSecondary(self): |
541 | 558 |
"""Test if this device needs to be created on a secondary node.""" |
542 | 559 |
return self.dev_type in (constants.DT_DRBD8, constants.DT_PLAIN) |
Also available in: Unified diff