Revision 152759e4 lib/backend.py
b/lib/backend.py | ||
---|---|---|
668 | 668 |
return map(fn, names) |
669 | 669 |
|
670 | 670 |
|
671 |
def GetNodeInfo(storage_units, hv_specs, excl_stor):
|
|
671 |
def GetNodeInfo(storage_units, hv_specs): |
|
672 | 672 |
"""Gives back a hash with different information about the node. |
673 | 673 |
|
674 |
@type storage_units: list of pairs (string, string) |
|
675 |
@param storage_units: List of pairs (storage unit, identifier) to ask for disk |
|
676 |
space information. In case of lvm-vg, the identifier is |
|
677 |
the VG name. |
|
674 |
@type storage_units: list of tuples (string, string, list) |
|
675 |
@param storage_units: List of tuples (storage unit, identifier, parameters) to |
|
676 |
ask for disk space information. In case of lvm-vg, the identifier is |
|
677 |
the VG name. The parameters can contain additional, storage-type-specific |
|
678 |
parameters, for example exclusive storage for lvm storage. |
|
678 | 679 |
@type hv_specs: list of pairs (string, dict of strings) |
679 | 680 |
@param hv_specs: list of pairs of a hypervisor's name and its hvparams |
680 |
@type excl_stor: boolean |
|
681 |
@param excl_stor: Whether exclusive_storage is active |
|
682 | 681 |
@rtype: tuple; (string, None/dict, None/dict) |
683 | 682 |
@return: Tuple containing boot ID, volume group information and hypervisor |
684 | 683 |
information |
... | ... | |
687 | 686 |
bootid = utils.ReadFile(_BOOT_ID_PATH, size=128).rstrip("\n") |
688 | 687 |
storage_info = _GetNamedNodeInfo( |
689 | 688 |
storage_units, |
690 |
(lambda storage_unit: _ApplyStorageInfoFunction(storage_unit[0], |
|
691 |
storage_unit[1], |
|
692 |
excl_stor))) |
|
689 |
(lambda (storage_type, storage_key, storage_params): |
|
690 |
_ApplyStorageInfoFunction(storage_type, storage_key, storage_params))) |
|
693 | 691 |
hv_info = _GetHvInfoAll(hv_specs) |
694 | 692 |
return (bootid, storage_info, hv_info) |
695 | 693 |
|
Also available in: Unified diff