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