|
|
|
@ -152,6 +152,7 @@ class VariableOsDeviceInvalidator(ReadonlyVariable):
|
|
|
|
|
res = os.read(self.master, 65535)
|
|
|
|
|
self.parent.Invalidate(self.name)
|
|
|
|
|
self.parent.Invalidate('os_install_disk_uuid')
|
|
|
|
|
self.parent.Invalidate('os_install_disk_partuuid')
|
|
|
|
|
self.parent.Invalidate('os_disk_dev')
|
|
|
|
|
device.udev.clear_cache()
|
|
|
|
|
except OSError as e:
|
|
|
|
@ -503,6 +504,7 @@ class VariableOsDiskData(ReadonlyTableVariable):
|
|
|
|
|
"""
|
|
|
|
|
source = ['os_disk_dev',
|
|
|
|
|
'os_disk_uuid',
|
|
|
|
|
'os_disk_partuuid',
|
|
|
|
|
'os_disk_name',
|
|
|
|
|
'os_disk_size',
|
|
|
|
|
'os_disk_part',
|
|
|
|
@ -682,6 +684,16 @@ class VariableOsDiskUuid(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
def get(self):
|
|
|
|
|
return self.mapUdevProperty('os_disk_dev', 'ID_FS_UUID', '')
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskPartuuid(DeviceHelper, ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
List uudi for partition devices
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
return self.mapUdevProperty('os_disk_dev', 'ID_PART_ENTRY_UUID', '')
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class VariableOsDiskParent(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
@ -1674,6 +1686,20 @@ class VariableOsInstallDiskUuid(ReadonlyVariable):
|
|
|
|
|
hashUUID = getUUIDDict(revers=True)
|
|
|
|
|
return map(lambda x: hashUUID.get(x, "")[5:], diskDev)
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskPartuuid(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|
Uudi for install
|
|
|
|
|
"""
|
|
|
|
|
type = "list"
|
|
|
|
|
|
|
|
|
|
def mapUdevProperty(self, var, prop, default):
|
|
|
|
|
"""Get each element from var through udev [prop]"""
|
|
|
|
|
return [device.udev.get_device_info(name=x).get(prop, default)
|
|
|
|
|
for x in self.Get(var)]
|
|
|
|
|
|
|
|
|
|
def get(self):
|
|
|
|
|
diskDev = self.Get('os_install_disk_dev')
|
|
|
|
|
return self.mapUdevProperty('os_install_disk_dev', 'ID_PART_ENTRY_UUID', '')
|
|
|
|
|
|
|
|
|
|
class VariableOsInstallDiskMountBase(ReadonlyVariable):
|
|
|
|
|
"""
|
|
|
|
|