LGTM. Thanks, Jose
On Apr 16 15:19, Ilias Tsitsimpis wrote: > This property returns the nodes covered by a disk. > > Signed-off-by: Ilias Tsitsimpis <[email protected]> > --- > lib/objects.py | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/lib/objects.py b/lib/objects.py > index 874951e..bd72e07 100644 > --- a/lib/objects.py > +++ b/lib/objects.py > @@ -537,6 +537,23 @@ class Disk(ConfigObject): > # is sent to, and should not be persisted. > ["dynamic_params"]) > > + def _ComputeAllNodes(self): > + """Compute the list of all nodes covered by a device and its children.""" > + def _Helper(nodes, device): > + """Recursively compute nodes given a top device.""" > + if device.dev_type in constants.DTS_DRBD: > + nodes.extend(device.logical_id[:2]) > + if device.children: > + for child in device.children: > + _Helper(nodes, child) > + > + all_nodes = list() > + _Helper(all_nodes, self) > + return tuple(set(all_nodes)) > + > + all_nodes = property(_ComputeAllNodes, None, None, > + "List of names of all the nodes of a disk") > + > def CreateOnSecondary(self): > """Test if this device needs to be created on a secondary node.""" > return self.dev_type in (constants.DT_DRBD8, constants.DT_PLAIN) > -- > 1.9.1 > -- Jose Antonio Lopes Ganeti Engineering Google Germany GmbH Dienerstr. 12, 80331, München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores Steuernummer: 48/725/00206 Umsatzsteueridentifikationsnummer: DE813741370
