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

master-3.5
parent fa3b455d1f
commit b1e46276fd

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

Loading…
Cancel
Save