Использование calculate-lib:Lvm

master-3.5
parent fa3b455d1f
commit b1e46276fd

@ -18,31 +18,23 @@ import sys
from calculate.lib.datavars import (Variable, VariableInterface, from calculate.lib.datavars import (Variable, VariableInterface,
ReadonlyVariable, ReadonlyTableVariable, ReadonlyVariable, ReadonlyTableVariable,
FieldValue, HumanReadable) FieldValue, HumanReadable)
from calculate.lib.utils.files import (process, checkUtils) from calculate.lib.utils import device
from calculate.lib.cl_lang import setLocalTranslate from calculate.lib.cl_lang import setLocalTranslate
setLocalTranslate('cl_install3', sys.modules[__name__]) setLocalTranslate('cl_install3', sys.modules[__name__])
class LvmHelper(VariableInterface): class LvmHelper(VariableInterface):
def getLvmData(self): def getLvmData(self):
"""Get route table, exclude specifed iface""" for vg, lv, pv in device.lvm.pvdisplay_full():
pvDisplayProg = checkUtils('/sbin/pvdisplay') yield lv, vg, pv
pvDisplay = process(pvDisplayProg, "--noh", "-Co",
"lv_name,vg_name,pv_name")
for line in pvDisplay:
line = line.split()
if len(line) == 3:
yield line
####################################################### #######################################################
# Devices variables # Devices variables
####################################################### #######################################################
class VariableOsLvmData(ReadonlyTableVariable, LvmHelper): class VariableOsLvmData(ReadonlyTableVariable, LvmHelper):
""" """
Information about disk devices Information about LVM
""" """
source = ['os_lvm_lvname', source = ['os_lvm_lvname',
'os_lvm_vgname', 'os_lvm_vgname',

Loading…
Cancel
Save