return lvnames
def _AllDisks(self):
- """Compute the list of all Disks.
+ """Compute the list of all Disks (recursively, including children).
"""
+ def DiskAndAllChildren(disk):
+ """Returns a list containing the given disk and all of his children.
+
+ """
+ disks = [disk]
+ if disk.children:
+ for child_disk in disk.children:
+ disks.extend(DiskAndAllChildren(child_disk))
+ return disks
+
disks = []
for instance in self._config_data.instances.values():
- disks.extend(instance.disks)
+ for disk in instance.disks:
+ disks.extend(DiskAndAllChildren(disk))
return disks
def _AllNICs(self):
return self._config_data.cluster.enabled_hypervisors[0]
@locking.ssynchronized(_config_lock, shared=1)
- def GetHostKey(self):
+ def GetRsaHostKey(self):
"""Return the rsa hostkey from the config.
@rtype: string
return self._config_data.cluster.rsahostkeypub
@locking.ssynchronized(_config_lock, shared=1)
+ def GetDsaHostKey(self):
+ """Return the dsa hostkey from the config.
+
+ @rtype: string
+ @return: the dsa hostkey
+
+ """
+ return self._config_data.cluster.dsahostkeypub
+
+ @locking.ssynchronized(_config_lock, shared=1)
def GetDefaultIAllocator(self):
"""Get the default instance allocator for this cluster.