|
|
@ -45,13 +45,13 @@ setLocalTranslate('cl_install3', sys.modules[__name__]) |
|
|
|
|
|
|
|
|
|
|
|
class DeviceHelper(VariableInterface): |
|
|
|
rePassDevice = re.compile("^/block/(?!%s)" % "|".join(['sr', 'fd', |
|
|
|
'ram', 'loop'])) |
|
|
|
rePassDevice = re.compile(r"^/block/(?!%s)" % r"|".join([r'sr', r'fd', |
|
|
|
r'ram', r'loop'])) |
|
|
|
|
|
|
|
def getBlockDevices(self): |
|
|
|
"""Get interest devices from sys block path""" |
|
|
|
return filter(self.rePassDevice.search, |
|
|
|
device.udev.get_block_devices()) |
|
|
|
return list(filter(self.rePassDevice.search, |
|
|
|
device.udev.get_block_devices())) |
|
|
|
|
|
|
|
def separateDevice(self, dev): |
|
|
|
""" |
|
|
@ -59,8 +59,8 @@ class DeviceHelper(VariableInterface): |
|
|
|
|
|
|
|
Using for sort. (Example: sda2 ("sda",2), md5p1 ("md",5,"p",1) |
|
|
|
""" |
|
|
|
return map(lambda x: int(x) if x.isdigit() else x, |
|
|
|
re.findall('\d+|\D+', dev)) |
|
|
|
return list(map(lambda x: int(x) if x.isdigit() else x, |
|
|
|
re.findall(r'\d+|\D+', dev))) |
|
|
|
|
|
|
|
def mapUdevProperty(self, var, prop, default): |
|
|
|
"""Get each element from var through udev [prop]""" |
|
|
@ -164,7 +164,7 @@ class VariableOsDeviceDev(DeviceHelper, ReadonlyVariable): |
|
|
|
Disk devices |
|
|
|
""" |
|
|
|
type = "list" |
|
|
|
re_disk_raid = re.compile("^disk-.*-raid\d+$", re.I) |
|
|
|
re_disk_raid = re.compile(r"^disk-.*-raid\d+$", re.I) |
|
|
|
|
|
|
|
def init(self): |
|
|
|
pass |
|
|
@ -228,8 +228,8 @@ class VariableOsDeviceType(ReadonlyVariable): |
|
|
|
device.devfs.listdir(diskIdPath, fullpath=False))) |
|
|
|
else: |
|
|
|
self.usbdevices = [] |
|
|
|
return map(self.getType, |
|
|
|
self.Get('os_device_dev')) |
|
|
|
return list(map(self.getType, |
|
|
|
self.Get('os_device_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceParent(ReadonlyVariable): |
|
|
@ -313,8 +313,8 @@ class VariableOsDeviceMap(ReadonlyVariable): |
|
|
|
type = "list" |
|
|
|
|
|
|
|
def get(self): |
|
|
|
return map(lambda x: str(x[0]), |
|
|
|
enumerate(self.Get('os_device_dev'))) |
|
|
|
return list(map(lambda x: str(x[0]), |
|
|
|
enumerate(self.Get('os_device_dev')))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceArraySet(ReadonlyVariable): |
|
|
@ -334,9 +334,9 @@ class VariableOsDeviceArraySet(ReadonlyVariable): |
|
|
|
else: |
|
|
|
return "off" |
|
|
|
|
|
|
|
return map(lambda x: isArray(*x), |
|
|
|
return list(map(lambda x: isArray(*x), |
|
|
|
zip(self.Get('os_device_dev'), |
|
|
|
self.Get('os_device_name'))) |
|
|
|
self.Get('os_device_name')))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceSsdSet(ReadonlyVariable): |
|
|
@ -361,9 +361,9 @@ class VariableOsDeviceSsdSet(ReadonlyVariable): |
|
|
|
else: |
|
|
|
return "off" |
|
|
|
|
|
|
|
return map(lambda x: isSsd(*x), |
|
|
|
return list(map(lambda x: isSsd(*x), |
|
|
|
zip(self.Get('os_device_dev'), |
|
|
|
self.Get('os_device_name'))) |
|
|
|
self.Get('os_device_name')))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceSyspath(ReadonlyVariable): |
|
|
@ -403,10 +403,10 @@ class VariableOsDeviceVirtualSet(ReadonlyVariable): |
|
|
|
else: |
|
|
|
return "off" |
|
|
|
|
|
|
|
return map(lambda x: isVirtual(*x), |
|
|
|
return list(map(lambda x: isVirtual(*x), |
|
|
|
zip(self.Get('os_device_dev'), |
|
|
|
self.Get('os_device_name'), |
|
|
|
self.Get('os_device_syspath'))) |
|
|
|
self.Get('os_device_syspath')))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceTable(ReadonlyVariable): |
|
|
@ -444,8 +444,8 @@ class VariableOsDeviceTable(ReadonlyVariable): |
|
|
|
else: |
|
|
|
return getTable(dev) |
|
|
|
|
|
|
|
return map(getByAutopartition, |
|
|
|
self.Get('os_device_dev')) |
|
|
|
return list(map(getByAutopartition, |
|
|
|
self.Get('os_device_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceName(ReadonlyVariable): |
|
|
@ -475,8 +475,8 @@ class VariableOsDeviceName(ReadonlyVariable): |
|
|
|
return "" |
|
|
|
|
|
|
|
def get(self): |
|
|
|
return map(self.getName, |
|
|
|
self.Get('os_device_dev')) |
|
|
|
return list(map(self.getName, |
|
|
|
self.Get('os_device_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDeviceSize(ReadonlyVariable): |
|
|
@ -487,12 +487,12 @@ class VariableOsDeviceSize(ReadonlyVariable): |
|
|
|
|
|
|
|
def get(self): |
|
|
|
"""Get device size""" |
|
|
|
return map(lambda x: getPartitionSize(name=x, inBytes=True), |
|
|
|
self.Get('os_device_dev')) |
|
|
|
return list(map(lambda x: getPartitionSize(name=x, inBytes=True), |
|
|
|
self.Get('os_device_dev'))) |
|
|
|
|
|
|
|
def humanReadable(self): |
|
|
|
return map(humanreadableSize, |
|
|
|
self.Get()) |
|
|
|
return list(map(humanreadableSize, |
|
|
|
self.Get())) |
|
|
|
|
|
|
|
|
|
|
|
############################################# |
|
|
@ -526,7 +526,7 @@ class VariableOsDiskDev(DeviceHelper, ReadonlyVariable): |
|
|
|
def get(self): |
|
|
|
# ะฟะพะปััะธัั ะฑะปะพัะฝัะต ััััะพะนััะฒะฐ, ะฒ ัะฟะธัะบะต ััััะพะนััะฒะฐ ั ัะฐะฑะปะธัะตะน ัะฐะทะดะตะปะฐ |
|
|
|
# ัะฐะทะดะตะปะตะฝั '/' |
|
|
|
re_parent = re.compile("^/block/[^/]+") |
|
|
|
re_parent = re.compile(r"^/block/[^/]+") |
|
|
|
disks = self.getBlockDevices() |
|
|
|
parents = {re_parent.search(x).group() |
|
|
|
for x in disks if x.count("/") > 2} |
|
|
@ -536,8 +536,8 @@ class VariableOsDiskDev(DeviceHelper, ReadonlyVariable): |
|
|
|
return list(sorted((x for x in dev_names), key=self.separateDevice)) |
|
|
|
|
|
|
|
def humanReadable(self): |
|
|
|
return map(self.getPerfectName, |
|
|
|
self.Get()) |
|
|
|
return list(map(self.getPerfectName, |
|
|
|
self.Get())) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskMount(DeviceHelper, ReadonlyVariable): |
|
|
@ -550,8 +550,8 @@ class VariableOsDiskMount(DeviceHelper, ReadonlyVariable): |
|
|
|
disk_hash = self.Get('os_disk_dev') |
|
|
|
fstab = FStab('/etc/fstab', devs=disk_hash) |
|
|
|
rootdev = self.Get('os_root_dev') |
|
|
|
return map(lambda x: '/' if x == rootdev else fstab.getBy(eq=x) or "", |
|
|
|
self.Get('os_disk_dev')) |
|
|
|
return list(map(lambda x: '/' if x == rootdev else fstab.getBy(eq=x) or "", |
|
|
|
self.Get('os_disk_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskContent(ReadonlyVariable): |
|
|
@ -564,8 +564,8 @@ class VariableOsDiskContent(ReadonlyVariable): |
|
|
|
""" |
|
|
|
TODO: need to write |
|
|
|
""" |
|
|
|
return map(lambda x: "", |
|
|
|
self.Get('os_disk_dev')) |
|
|
|
return list(map(lambda x: "", |
|
|
|
self.Get('os_disk_dev'))) |
|
|
|
|
|
|
|
class VariableOsDiskFormat(ReadonlyVariable): |
|
|
|
""" |
|
|
@ -593,8 +593,8 @@ class VariableOsDiskFormat(ReadonlyVariable): |
|
|
|
pass |
|
|
|
return fs |
|
|
|
|
|
|
|
return map(getFormat, |
|
|
|
self.Get('os_disk_dev')) |
|
|
|
return list(map(getFormat, |
|
|
|
self.Get('os_disk_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskType(ReadonlyVariable): |
|
|
@ -602,8 +602,8 @@ class VariableOsDiskType(ReadonlyVariable): |
|
|
|
List type (lvm,raid,partition,disk) |
|
|
|
""" |
|
|
|
type = "list" |
|
|
|
re_raid = re.compile("-raid\d+$") |
|
|
|
re_raid_partition = re.compile("-raid\d+-partition$") |
|
|
|
re_raid = re.compile(r"-raid\d+$") |
|
|
|
re_raid_partition = re.compile(r"-raid\d+-partition$") |
|
|
|
|
|
|
|
def get(self): |
|
|
|
"""Get partition scheme""" |
|
|
@ -642,9 +642,9 @@ class VariableOsDiskType(ReadonlyVariable): |
|
|
|
lvmUsedDisks[x].append(dev) |
|
|
|
else: |
|
|
|
lvmUsedDisks[x] = [dev] |
|
|
|
return map(lambda x: x[1], |
|
|
|
return list(map(lambda x: x[1], |
|
|
|
map(forMember, |
|
|
|
types)) |
|
|
|
types))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskRaid(ReadonlyVariable): |
|
|
@ -672,8 +672,8 @@ class VariableOsDiskLvm(DeviceHelper, ReadonlyVariable): |
|
|
|
|
|
|
|
def get(self): |
|
|
|
"""Get each element from var through udev [prop]""" |
|
|
|
return map(self.getLvmName, |
|
|
|
self.Get('os_disk_dev')) |
|
|
|
return list(map(self.getLvmName, |
|
|
|
self.Get('os_disk_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskUuid(DeviceHelper, ReadonlyVariable): |
|
|
@ -723,10 +723,10 @@ class VariableOsDiskId(DeviceHelper, ReadonlyVariable): |
|
|
|
'21686148-6449-6e6f-744e-656564454649': 'EF02', |
|
|
|
'c12a7328-f81f-11d2-ba4b-00a0c93ec93b': 'EF00', |
|
|
|
'0fc63daf-8483-4772-8e79-3d69d8477de4': '8300'} |
|
|
|
return map(lambda x: mapTypeUUID.get(x, x), |
|
|
|
return list(map(lambda x: mapTypeUUID.get(x, x), |
|
|
|
map(lambda x: x.rpartition("x")[2], |
|
|
|
self.mapUdevProperty('os_disk_dev', 'ID_PART_ENTRY_TYPE', |
|
|
|
''))) |
|
|
|
'')))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskGrub(ReadonlyVariable): |
|
|
@ -753,10 +753,10 @@ class VariableOsDiskGrub(ReadonlyVariable): |
|
|
|
else: |
|
|
|
return "" |
|
|
|
|
|
|
|
return map(getGrubMap, |
|
|
|
return list(map(getGrubMap, |
|
|
|
zip(self.Get('os_disk_dev'), |
|
|
|
self.Get('os_disk_type'), |
|
|
|
self.Get('os_disk_parent'))) |
|
|
|
self.Get('os_disk_parent')))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskPart(ReadonlyVariable): |
|
|
@ -786,12 +786,12 @@ class VariableOsDiskSize(ReadonlyVariable): |
|
|
|
|
|
|
|
def get(self): |
|
|
|
"""Get disk size""" |
|
|
|
return map(lambda x: getPartitionSize(name=x, inBytes=True), |
|
|
|
self.Get('os_disk_dev')) |
|
|
|
return list(map(lambda x: getPartitionSize(name=x, inBytes=True), |
|
|
|
self.Get('os_disk_dev'))) |
|
|
|
|
|
|
|
def humanReadable(self): |
|
|
|
return map(humanreadableSize, |
|
|
|
self.Get()) |
|
|
|
return list(map(humanreadableSize, |
|
|
|
self.Get())) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskName(DeviceHelper, ReadonlyVariable): |
|
|
@ -817,8 +817,8 @@ class VariableOsDiskOptions(ReadonlyVariable): |
|
|
|
def getFormat(dev): |
|
|
|
return fstab.getBy(what=fstab.OPTS, eq=dev) |
|
|
|
|
|
|
|
return map(getFormat, |
|
|
|
self.Get('os_disk_dev')) |
|
|
|
return list(map(getFormat, |
|
|
|
self.Get('os_disk_dev'))) |
|
|
|
|
|
|
|
|
|
|
|
################################################ |
|
|
@ -1042,11 +1042,11 @@ class VariableOsLocationSource(LocationHelper, DeviceHelper, Variable): |
|
|
|
return path.normpath(val) |
|
|
|
return val |
|
|
|
|
|
|
|
return map(normpath, value) |
|
|
|
return list(map(normpath, value)) |
|
|
|
|
|
|
|
def choice(self): |
|
|
|
return map(lambda x: (x, self.getPerfectName(x) or x), |
|
|
|
self.fixOsDiskDev(self.availDevs(choice=True))) + [("", "")] |
|
|
|
return list(map(lambda x: (x, self.getPerfectName(x) or x), |
|
|
|
self.fixOsDiskDev(self.availDevs(choice=True)))) + [("", "")] |
|
|
|
|
|
|
|
def fixOsDiskDev(self, sourcelist=None): |
|
|
|
""" |
|
|
@ -1141,12 +1141,12 @@ class VariableOsLocationDest(LocationHelper, Variable): |
|
|
|
return "" |
|
|
|
return mount |
|
|
|
|
|
|
|
return map(installMountPoint, |
|
|
|
return list(map(installMountPoint, |
|
|
|
filter(lambda x: x[0] in source, |
|
|
|
zip(self.Get('os_disk_dev'), |
|
|
|
self.Get('os_disk_mount')) + \ |
|
|
|
zip(self.Get('os_bind_path'), |
|
|
|
self.Get('os_bind_mountpoint')))) |
|
|
|
list(zip(self.Get('os_disk_dev'), |
|
|
|
self.Get('os_disk_mount'))) + \ |
|
|
|
list(zip(self.Get('os_bind_path'), |
|
|
|
self.Get('os_bind_mountpoint')))))) |
|
|
|
|
|
|
|
def set(self, value): |
|
|
|
"""Add abilitiy not specify root""" |
|
|
@ -1157,7 +1157,7 @@ class VariableOsLocationDest(LocationHelper, Variable): |
|
|
|
return val |
|
|
|
|
|
|
|
value = map(normpath, value) |
|
|
|
return map(lambda x: x or "/", value) |
|
|
|
return list(map(lambda x: x or "/", value)) |
|
|
|
|
|
|
|
def choice(self): |
|
|
|
if self.Get('cl_install_type') == 'flash': |
|
|
@ -1179,7 +1179,7 @@ class VariableOsLocationDest(LocationHelper, Variable): |
|
|
|
not "/usr" in value: |
|
|
|
for mp, size in filter(lambda x: x[0] == '/' and x[1].isdigit() and \ |
|
|
|
int(x[1]) < minroot, |
|
|
|
izip(value, |
|
|
|
zip(value, |
|
|
|
self.Get("os_location_size"))): |
|
|
|
raise VariableError( |
|
|
|
_("The root partition should be at least %s") % "7 Gb") |
|
|
@ -1189,19 +1189,19 @@ class VariableOsLocationDest(LocationHelper, Variable): |
|
|
|
################################ |
|
|
|
if not source: |
|
|
|
return |
|
|
|
if not filter(lambda x: x == "/", value): |
|
|
|
if not list(filter(lambda x: x == "/", value)): |
|
|
|
raise VariableError(_("To install the system, you need to " |
|
|
|
"specify the root device")) |
|
|
|
################################ |
|
|
|
disks = filter(lambda x: x[0].startswith('/dev/') and x[1], |
|
|
|
zip(source, value)) |
|
|
|
disksDevs = map(lambda x: x[0], disks) |
|
|
|
binds = filter(lambda x: not x[0].startswith('/dev/') and x[1], |
|
|
|
zip(source, value)) |
|
|
|
disks = list(filter(lambda x: x[0].startswith('/dev/') and x[1], |
|
|
|
zip(source, value))) |
|
|
|
disksDevs = list(map(lambda x: x[0], disks)) |
|
|
|
binds = list(filter(lambda x: not x[0].startswith('/dev/') and x[1], |
|
|
|
zip(source, value))) |
|
|
|
########################## |
|
|
|
# detect efi specifing |
|
|
|
########################## |
|
|
|
reEfi = re.compile("/u?efi", re.I) |
|
|
|
reEfi = re.compile(r"/u?efi", re.I) |
|
|
|
if any(reEfi.search(x) for x in value): |
|
|
|
if self.Get('cl_client_type') == 'gui': |
|
|
|
raise VariableError( |
|
|
@ -1271,10 +1271,10 @@ class VariableOsLocationDest(LocationHelper, Variable): |
|
|
|
DEVICE, MP = 0, 1 |
|
|
|
srcMountPoints = map(lambda x: x[DEVICE], binds) |
|
|
|
destMountPoints = map(lambda x: x[MP], binds) |
|
|
|
wrongBind = filter(lambda x: x in destMountPoints, srcMountPoints) |
|
|
|
wrongBind = list(filter(lambda x: x in destMountPoints, srcMountPoints)) |
|
|
|
if wrongBind: |
|
|
|
incompBind = filter(lambda x: x[1] == wrongBind[0], |
|
|
|
zip(srcMountPoints, destMountPoints)) |
|
|
|
incompBind = list(filter(lambda x: x[1] == wrongBind[0], |
|
|
|
zip(srcMountPoints, destMountPoints))) |
|
|
|
raise VariableError( |
|
|
|
_("Source directory %(src)s is already used " |
|
|
|
"for binding '%(bindSrc)s' to '%(bindDst)s'") \ |
|
|
@ -1298,8 +1298,8 @@ class VariableOsLocationDest(LocationHelper, Variable): |
|
|
|
installTypes = zip(self.Get('os_install_disk_dev'), |
|
|
|
self.Get('os_install_disk_type')) |
|
|
|
for checkType in ("raid", "lvm"): |
|
|
|
memberData = filter(lambda x: checkType + "member" in x[1], |
|
|
|
installTypes) |
|
|
|
memberData = list(filter(lambda x: checkType + "member" in x[1], |
|
|
|
installTypes)) |
|
|
|
if memberData: |
|
|
|
raise VariableError( |
|
|
|
_("Unable to use {part} partition used by active " |
|
|
@ -1317,13 +1317,13 @@ class VariableOsLocationFormat(LocationHelper, Variable): |
|
|
|
def get(self): |
|
|
|
if self.Get('cl_autopartition_set') == "on": |
|
|
|
return self.Get('cl_autopartition_disk_format') + \ |
|
|
|
map(lambda x: "", self.Get('cl_autopartition_bind_path')) |
|
|
|
list(map(lambda x: "", self.Get('cl_autopartition_bind_path'))) |
|
|
|
else: |
|
|
|
mount = self.Get("os_location_dest") |
|
|
|
source = self.Get("os_location_source") |
|
|
|
value = [""] * len(source) |
|
|
|
return map(self.defaultFormat(), |
|
|
|
zip(source, mount, value)) |
|
|
|
return list(map(self.defaultFormat(), |
|
|
|
zip(source, mount, value))) |
|
|
|
|
|
|
|
def choice(self): |
|
|
|
if self.Get('cl_install_type') == "flash": |
|
|
@ -1384,8 +1384,8 @@ class VariableOsLocationFormat(LocationHelper, Variable): |
|
|
|
value = map(lambda x: "vfat" if x == "uefi" else x, value) |
|
|
|
mount = self.Get("os_location_dest") |
|
|
|
source = self.Get("os_location_source") |
|
|
|
return map(self.defaultFormat(), |
|
|
|
zip(source, mount, value)) |
|
|
|
return list(map(self.defaultFormat(), |
|
|
|
zip(source, mount, value))) |
|
|
|
|
|
|
|
def check(self, value): |
|
|
|
osInstallRootType = self.Get('os_install_root_type') |
|
|
@ -1423,17 +1423,17 @@ class VariableOsLocationPerformFormat(LocationHelper, Variable): |
|
|
|
|
|
|
|
def get(self): |
|
|
|
if self.Get('cl_autopartition_set') == "on": |
|
|
|
return map(lambda x: "on", |
|
|
|
self.Get('cl_autopartition_disk_format')) + \ |
|
|
|
map(lambda x: "", |
|
|
|
self.Get('cl_autopartition_bind_path')) |
|
|
|
return list(map(lambda x: "on", |
|
|
|
self.Get('cl_autopartition_disk_format'))) + \ |
|
|
|
list(map(lambda x: "", |
|
|
|
self.Get('cl_autopartition_bind_path'))) |
|
|
|
else: |
|
|
|
mount = self.Get("os_location_dest") |
|
|
|
source = self.Get("os_location_source") |
|
|
|
fs = self.Get("os_location_format") |
|
|
|
value = [""] * len(source) |
|
|
|
return map(self.defaultPerformFormat(), |
|
|
|
zip(source, mount, fs, value)) |
|
|
|
return list(map(self.defaultPerformFormat(), |
|
|
|
zip(source, mount, fs, value))) |
|
|
|
|
|
|
|
fixNtfs = lambda self, x: {'ntfs-3g': 'ntfs'}.get(x, x) |
|
|
|
|
|
|
@ -1531,11 +1531,11 @@ class VariableOsLocationPerformFormat(LocationHelper, Variable): |
|
|
|
self.Get('os_location_dest'), |
|
|
|
self.Get('os_location_format'), |
|
|
|
value) |
|
|
|
return map(self.defaultPerformFormat(), |
|
|
|
return list(map(self.defaultPerformFormat(), |
|
|
|
map(lambda x: [x[DEV], x[MP], x[FS], ""] \ |
|
|
|
if x[FORMAT] == "off" and not x[DEV].startswith("/dev/") |
|
|
|
else x, |
|
|
|
info)) |
|
|
|
info))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsLocationSize(LocationHelper, SourceReadonlyVariable): |
|
|
@ -1678,8 +1678,8 @@ class VariableOsInstallDiskDev(ReadonlyVariable, DeviceHelper): |
|
|
|
self.Get('os_install_disk_dev_base')) |
|
|
|
|
|
|
|
def humanReadable(self): |
|
|
|
return map(lambda x: self.getPerfectName(x, defaultValue=x), |
|
|
|
self.Get()) |
|
|
|
return list(map(lambda x: self.getPerfectName(x, defaultValue=x), |
|
|
|
self.Get())) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskUuid(ReadonlyVariable): |
|
|
@ -1691,7 +1691,7 @@ class VariableOsInstallDiskUuid(ReadonlyVariable): |
|
|
|
def get(self): |
|
|
|
diskDev = self.Get('os_install_disk_dev') |
|
|
|
hashUUID = getUUIDDict(revers=True) |
|
|
|
return map(lambda x: hashUUID.get(x, "")[5:], diskDev) |
|
|
|
return list(map(lambda x: hashUUID.get(x, "")[5:], diskDev)) |
|
|
|
|
|
|
|
class VariableOsInstallDiskPartuuid(ReadonlyVariable): |
|
|
|
""" |
|
|
@ -1756,9 +1756,9 @@ class VariableOsInstallDiskUse(ReadonlyVariable): |
|
|
|
def get(self): |
|
|
|
"""Get real id (by cl_uuid_set) device""" |
|
|
|
if self.Get('cl_uuid_set') == "on": |
|
|
|
return map(lambda x: "UUID=%s" % x[0] if x[0] else x[1], |
|
|
|
return list(map(lambda x: "UUID=%s" % x[0] if x[0] else x[1], |
|
|
|
zip(self.Get('os_install_disk_uuid'), |
|
|
|
self.Get('os_install_disk_dev'))) |
|
|
|
self.Get('os_install_disk_dev')))) |
|
|
|
else: |
|
|
|
return self.Get('os_install_disk_dev') |
|
|
|
|
|
|
@ -1820,11 +1820,11 @@ class VariableOsInstallDiskPerformFormat(ReadonlyVariable): |
|
|
|
type = "bool-list" |
|
|
|
|
|
|
|
def get(self): |
|
|
|
_format = map(lambda x: x[2], |
|
|
|
_format = list(map(lambda x: x[2], |
|
|
|
filter(lambda x: x[0].startswith('/dev/') and x[1], |
|
|
|
zip(self.Get('os_location_source'), |
|
|
|
self.Get('os_location_dest'), |
|
|
|
self.Get('os_location_perform_format')))) |
|
|
|
self.Get('os_location_perform_format'))))) |
|
|
|
if self.GetBool('cl_autopartition_set'): |
|
|
|
efiformat = ['on' for x in self.Get('os_install_uefi')] |
|
|
|
res = efiformat + _format |
|
|
@ -1880,9 +1880,9 @@ class VariableOsInstallDiskName(Variable): |
|
|
|
else: |
|
|
|
return diskLabel.get(dev, '') |
|
|
|
|
|
|
|
return map(changeLabel, |
|
|
|
return list(map(changeLabel, |
|
|
|
self.ZipVars('os_install_disk_dev', |
|
|
|
'os_install_disk_mount')) |
|
|
|
'os_install_disk_mount'))) |
|
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskSize(SourceReadonlyVariable): |
|
|
@ -2058,7 +2058,7 @@ class VariableOsInstallUefi(LocationHelper, Variable): |
|
|
|
opt = ["--uefi"] |
|
|
|
metavalue = "EFI" |
|
|
|
|
|
|
|
re_not0_raid = re.compile("-raid[1-9]") |
|
|
|
re_not0_raid = re.compile(r"-raid[1-9]") |
|
|
|
|
|
|
|
def init(self): |
|
|
|
self.label = _("UEFI boot") |
|
|
@ -2118,7 +2118,7 @@ class VariableOsInstallUefi(LocationHelper, Variable): |
|
|
|
return self.select('os_device_efi', |
|
|
|
os_device_dev=efidev, limit=1) or efidev |
|
|
|
return efidev |
|
|
|
return filter(lambda x: x != "off", map(transform, value)) |
|
|
|
return list(filter(lambda x: x != "off", map(transform, value))) |
|
|
|
|
|
|
|
def choice(self): |
|
|
|
deviceParentMap = self.ZipVars('os_device_dev', |
|
|
@ -2233,7 +2233,7 @@ class VariableOsInstallMbr(LocationHelper, Variable): |
|
|
|
|
|
|
|
def set(self, value): |
|
|
|
# support off value |
|
|
|
return filter(lambda x: x != "off", value) |
|
|
|
return list(filter(lambda x: x != "off", value)) |
|
|
|
|
|
|
|
def check(self, value): |
|
|
|
if self.GetBool('cl_autopartition_set'): |
|
|
|