|
|
|
@ -116,7 +116,7 @@ class fillVars(object, glob_attr):
|
|
|
|
|
devices = filter( lambda x: not reWrongDevice.search(x),
|
|
|
|
|
listdir('/sys/block'))
|
|
|
|
|
device_hash = {}
|
|
|
|
|
for mapnum,device in enumerate(sorted(devices)):
|
|
|
|
|
for mapnum,device in enumerate(sorted(devices,key=self.separateDevice)):
|
|
|
|
|
device_hash[device] = {}
|
|
|
|
|
device_hash[device]['map'] = mapnum
|
|
|
|
|
if device in usbdevices:
|
|
|
|
@ -253,14 +253,20 @@ class fillVars(object, glob_attr):
|
|
|
|
|
disk_hash[dev]['format'] = dictFormatList[dev]
|
|
|
|
|
return disk_hash
|
|
|
|
|
|
|
|
|
|
def separateDevice(self,device):
|
|
|
|
|
return map(lambda x: int(x) if x.isdigit() else x,
|
|
|
|
|
re.findall('\d+|\D+',device))
|
|
|
|
|
|
|
|
|
|
def get_os_disk_dev(self):
|
|
|
|
|
"""List of available partition devices"""
|
|
|
|
|
return sorted(self.Get('os_disk_hash').keys())
|
|
|
|
|
return sorted(self.Get('os_disk_hash').keys(),
|
|
|
|
|
key=self.separateDevice)
|
|
|
|
|
|
|
|
|
|
def getAttributeFromHash(self,var,attr):
|
|
|
|
|
hash = self.Get(var)
|
|
|
|
|
return map(lambda x: hash[x][attr] if attr in hash[x] else "",
|
|
|
|
|
sorted(hash.keys()))
|
|
|
|
|
sorted(hash.keys(),
|
|
|
|
|
key=self.separateDevice))
|
|
|
|
|
|
|
|
|
|
def get_os_install_disk_id(self):
|
|
|
|
|
"""List id for partition after installation"""
|
|
|
|
@ -315,13 +321,15 @@ class fillVars(object, glob_attr):
|
|
|
|
|
else:
|
|
|
|
|
return mount_point
|
|
|
|
|
return map(lambda x: getMountPoint(x),
|
|
|
|
|
sorted(self.Get('os_disk_hash').keys()))
|
|
|
|
|
sorted(self.Get('os_disk_hash').keys(),
|
|
|
|
|
key=self.separateDevice))
|
|
|
|
|
|
|
|
|
|
def get_os_disk_mount(self):
|
|
|
|
|
"""List mounted points for current operation system"""
|
|
|
|
|
disk_hash = self.Get('os_disk_hash')
|
|
|
|
|
return map(lambda x: isFstabMount(x) or "",
|
|
|
|
|
sorted(self.Get('os_disk_hash').keys()))
|
|
|
|
|
sorted(self.Get('os_disk_hash').keys(),
|
|
|
|
|
key=self.separateDevice))
|
|
|
|
|
|
|
|
|
|
def get_os_disk_format(self):
|
|
|
|
|
"""List filesystem for partition devices"""
|
|
|
|
@ -353,7 +361,8 @@ class fillVars(object, glob_attr):
|
|
|
|
|
|
|
|
|
|
def get_os_device_dev(self):
|
|
|
|
|
"""Devices"""
|
|
|
|
|
return sorted(self.Get('os_device_hash').keys())
|
|
|
|
|
return sorted(self.Get('os_device_hash').keys(),
|
|
|
|
|
key=self.separateDevice)
|
|
|
|
|
|
|
|
|
|
def get_os_device_type(self):
|
|
|
|
|
"""Device type (hdd,cdrom,usb-flash)"""
|
|
|
|
@ -378,7 +387,8 @@ class fillVars(object, glob_attr):
|
|
|
|
|
self.Get('os_install_disk_mount'),
|
|
|
|
|
self.Get('os_install_disk_format'),
|
|
|
|
|
self.Get('os_install_disk_options'))),
|
|
|
|
|
lambda x,y: cmp(x[1],y[1]))
|
|
|
|
|
lambda x,y: cmp(self.separateDevice(x[1]),
|
|
|
|
|
self.separateDevice(y[1])))
|
|
|
|
|
if self.Get('os_install_scratch') == "on":
|
|
|
|
|
devicesForFstab = filter(lambda x:x[1] != "/", devicesForFstab)
|
|
|
|
|
|
|
|
|
|