|
|
|
@ -395,6 +395,33 @@ class fillVars(object, glob_attr):
|
|
|
|
|
"""Install list filesystem for partition devices"""
|
|
|
|
|
return self.Get('os_disk_format')
|
|
|
|
|
|
|
|
|
|
def get_os_install_disk_grub(self):
|
|
|
|
|
"""List grub id for partition devices"""
|
|
|
|
|
def swapfirstnum(x,first,second):
|
|
|
|
|
disk,delimeter,part = x.partition(',')
|
|
|
|
|
if disk == str(first):
|
|
|
|
|
return "%d,%s"%(second,part)
|
|
|
|
|
elif disk == str(second):
|
|
|
|
|
return "%d,%s"%(first,part)
|
|
|
|
|
return x
|
|
|
|
|
|
|
|
|
|
curDiskGrub = self.getAttributeFromHash('os_disk_hash','grub')
|
|
|
|
|
bootDev=sorted(
|
|
|
|
|
filter(lambda x:x[0] in ('/','/boot'),
|
|
|
|
|
zip(self.Get('os_install_disk_mount'),
|
|
|
|
|
self.Get('os_disk_grub'))),
|
|
|
|
|
key=lambda x:x[0],reverse=True)
|
|
|
|
|
if bootDev:
|
|
|
|
|
bootDev=bootDev[0][1].partition(',')[0]
|
|
|
|
|
bootDevName = filter(lambda x:str(x[1])==bootDev,
|
|
|
|
|
zip(self.Get('os_device_dev'),
|
|
|
|
|
self.Get('os_device_map')))
|
|
|
|
|
if bootDevName:
|
|
|
|
|
if bootDevName[0][0] == self.Get('os_install_mbr'):
|
|
|
|
|
return map(lambda x:swapfirstnum(x,bootDevName[0][1],0),
|
|
|
|
|
curDiskGrub)
|
|
|
|
|
return curDiskGrub
|
|
|
|
|
|
|
|
|
|
def get_os_disk_grub(self):
|
|
|
|
|
"""List grub id for partition devices"""
|
|
|
|
|
return self.getAttributeFromHash('os_disk_hash','grub')
|
|
|
|
|