Fix for LVM.

lvmraid
Mike Hiretsky 13 years ago
parent d2085307aa
commit cea3da200b

@ -28,7 +28,7 @@ from cl_utils import isMount,typeFile,getTupleVersion,pathJoin,isFstabMount,\
isPkgInstalled, process, checkUtils, readLinesFile, \
FStab, lspci, getInstalledVideo,getDeviceType, \
getPartitionType, getOsProberHash, getProgPath, \
getRaidPartitions, getLvmPartitions
getRaidPartitions, getLvmPartitions, getLvmGroups
from cl_distr import DistributiveRepository,PartitionDistributive
from cl_fill import clLocale
from operator import itemgetter
@ -286,9 +286,12 @@ class fillVars(object, glob_attr):
# refresh LVM
vgscan = getProgPath('/sbin/vgscan')
vgchange = getProgPath('/sbin/vgchange')
if vgscan and vgchange:
lvchange = getProgPath('/sbin/lvchange')
if vgscan and vgchange and lvchange:
process(vgscan).success()
process(vgchange,'-ay','--refresh').success()
for group in getLvmGroups():
process(lvchange,'-ay','--refresh',group).success()
devicesHash = self.Get('os_device_hash')
sysBlockPath = '/sys/block'
new_disks = reduce(lambda x,y:x+ ([y] if type(y) == str else y),
@ -431,7 +434,8 @@ class fillVars(object, glob_attr):
"""List mounted points for current operation system"""
disk_hash = self.Get('os_disk_hash')
fstab = FStab('/etc/fstab')
return map(lambda x: fstab.getBy(eq=x) or "",
rootdev = self.Get('os_root_dev')
return map(lambda x: '/' if x == rootdev else fstab.getBy(eq=x) or "",
sorted(self.Get('os_disk_hash').keys(),
key=self.separateDevice))

Loading…
Cancel
Save