utils Module

Inheritance diagram of utils

class utils.BlivetUtils(main_window, kickstart=False)

Class with utils directly working with blivet itselves

add_device(user_input)

Create new device

Parameters:user_input (class UserInput) – selected parameters from AddDialog
Returns:new device name
Return type:str
blivet_do_it()

Blivet.doIt()

blivet_reload()
blivet_reset()

Blivet.reset()

create_disk_label(blivet_device, label_type)

Create disklabel

Parameters:
  • blivet_device (blivet.Device) – blivet device
  • label_type (str) – type of label to create
create_kickstart_file(fname)

Create kickstart config file

delete_device(blivet_device)

Delete device

Parameters:blivet_device (blivet.Device) – blivet device
device_resizable(blivet_device)

Is given device resizable

Parameters:blivet_device (blivet.Device) – blivet device
Returns:device resizable, minSize, maxSize, size
Return type:tuple
edit_partition_device(blivet_device, settings)

Edit device

Parameters:
  • blivet_device (blivet.Device) – blivet.Device
  • settings (tuple) – resize, target_size, target_fs
Returns:

success

Return type:

bool

get_available_disklabels()

Return disklabels available on current platform

Returns:list of disklabel types
Return type:list of str
get_blivet_device(device_name)

Get blivet device by name

Parameters:device_name (str) – device name
Returns:blviet device
Return type:blivet.StorageDevice
get_btrfs_volumes()

Return list of Btrfs Volumes

Returns:list of btrfs volumes
Return type:list
get_device_type(blivet_device)

Get device type

Parameters:blivet_device – blivet device
Returns:type of device
Return type:str
get_disk_names()

Return list of names of all disk devices on current system

Returns:list of all “disk” devices names
Return type:list
get_disks()

Return list of all disk devices on current system

Returns:list of all “disk” devices
Return type:list
get_free_disks_info()

Returns list of disks with free space

get_free_pvs_info()

Return list of PVs without VGs

Returns:list of free PVs with name and size
Return type:tuple
get_free_space(blivet_device, partitions)

Find free space on device

Parameters:
  • blivet_device (blivet.Device) – blivet device
  • paritions – partions (children) of device
Returns:

list of partitions + free space

Return type:

list

get_group_devices()

Return list of LVM2 Volume Group devices

Returns:list of LVM2 VG devices
Return type:list
get_parent_pvs(blivet_device)

Return list of LVM VG PVs

Parameters:blivet_device (blivet.Device) – blivet device
Returns:list of devices
Return type:list of blivet.StorageDevice
get_partitions(blivet_device)

Get partitions (children) of selected device

Parameters:blivet_device (blivet.Device) – blivet device
Returns:list of partitions
Return type:list
get_physical_devices()

Return list of LVM2 Physical Volumes

Returns:list of LVM2 PV devices
Return type:list
has_disklabel(blivet_device)

Has this disk device disklabel

Parameters:blivet_device (blivet.Device) – blivet device
Returns:true/false
Return type:bool
kickstart_mountpoints()
kickstart_use_disks(disk_names)
luks_decrypt(blivet_device, passphrase)

Decrypt selected luks device

Parameters:
  • blivet_device (LUKSDevice) – device to decrypt
  • passphrase (str) – passphrase
override_devicetree(devicetree)
return_devicetree
set_bootloader_device(disk_name)
class utils.FreeSpaceDevice(free_size, parents, logical=False)

Special class to represent free space on disk (device) (blivet doesn’t have class/device to represent free space)

Parameters:
  • free_size (blivet.Size) – size of free space
  • parents (list #FIXME blivet.devices.ParentList) – list of parent devices
  • logical (bool) – is this free space inside extended partition
utils.os_umount_partition(mountpoint)

Umount selected partition

Parameters:mountpoint (str) – mountpoint (os.path)
Returns:success
Return type:bool
utils.partition_mounted(partition_path)

Is selected partition partition_mounted

Parameters:
  • partition_path – /dev path for partition
  • type – str
Returns:

mountpoint

Return type:

str

utils.swap_is_on(sysfs_path)

Is selected swap in use?

Parameters:sysfs_path (str) – sysfs path for swap

This Page