Revision 52a8a6ae lib/backend.py
b/lib/backend.py | ||
---|---|---|
573 | 573 |
raise errors.QuitGanetiException(True, "Shutdown scheduled") |
574 | 574 |
|
575 | 575 |
|
576 |
def _GetLvmVgSpaceInfo(name, params): |
|
577 |
"""Wrapper around C{_GetVgInfo} which checks the storage parameters. |
|
578 |
|
|
579 |
@type name: string |
|
580 |
@param name: name of the volume group |
|
581 |
@type params: list |
|
582 |
@param params: list of storage parameters, which in this case should be |
|
583 |
containing only one for exclusive storage |
|
584 |
|
|
585 |
""" |
|
586 |
if params is None: |
|
587 |
raise errors.ProgrammerError("No storage parameter for LVM vg storage" |
|
588 |
" reporting is provided.") |
|
589 |
if not isinstance(params, list): |
|
590 |
raise errors.ProgrammerError("The storage parameters are not of type" |
|
591 |
" list: '%s'" % params) |
|
592 |
if not len(params) == 1: |
|
593 |
raise errors.ProgrammerError("Received more than one storage parameter:" |
|
594 |
" '%s'" % params) |
|
595 |
excl_stor = bool(params[0]) |
|
596 |
return _GetVgInfo(name, excl_stor) |
|
597 |
|
|
598 |
|
|
576 | 599 |
def _GetVgInfo(name, excl_stor): |
577 | 600 |
"""Retrieves information about a LVM volume group. |
578 | 601 |
|
... | ... | |
714 | 737 |
constants.ST_EXT: None, |
715 | 738 |
constants.ST_FILE: _GetFileStorageSpaceInfo, |
716 | 739 |
constants.ST_LVM_PV: _GetVgSpindlesInfo, |
717 |
constants.ST_LVM_VG: _GetVgInfo,
|
|
740 |
constants.ST_LVM_VG: _GetLvmVgSpaceInfo,
|
|
718 | 741 |
constants.ST_RADOS: None, |
719 | 742 |
} |
720 | 743 |
|
Also available in: Unified diff