blivet.tasks package

Submodules

blivet.tasks.availability module

class blivet.tasks.availability.AppVersionInfo(app_name, required_version, version_opt, version_regex)

Bases: object

Initializer.

Parameters:
  • app_name (str) – the name of the application

  • required_version (distutils.LooseVersion or NoneType) – the required version for this application

  • version_opt – command line option to print version of this application

  • version_regex – regular expression to extract version from output of @version_opt

class blivet.tasks.availability.BlockDevFSMethod(operation, check_fn, fstype)

Bases: Method

Methods for when application is actually a libblockdev FS plugin functionality.

Initializer.

Parameters:
  • operation – operation to check for support availability

  • check_fn – function used to check for support availability

  • fstype – filesystem type to check for the support availability

availability_errors(resource)

Returns [] if the plugin is loaded and functionality available.

Parameters:

resource (ExternalResource) – a libblockdev plugin

Returns:

[] if the name of the plugin is loaded

Return type:

list of str

class blivet.tasks.availability.BlockDevMethod(tech_info)

Bases: Method

Methods for when application is actually a libblockdev plugin.

Initializer.

:param AppVersionInfo version_info:

availability_errors(resource)

Returns [] if the plugin is loaded.

Parameters:

resource (ExternalResource) – a libblockdev plugin

Returns:

[] if the name of the plugin is loaded

Return type:

list of str

class blivet.tasks.availability.BlockDevTechInfo(plugin_name, check_fn, technologies)

Bases: object

Initializer.

Parameters:
  • plugin_name (str) – the name of the libblockdev plugin

  • check_fn – function used to check for support availability

  • technologies – list of required technologies

class blivet.tasks.availability.DBusMethod(dbus_name, dbus_path)

Bases: Method

Methods for when application is actually a DBus service.

Initializer.

:param AppVersionInfo version_info:

availability_errors(resource)

Returns [] if the service is available.

Parameters:

resource (ExternalResource) – a DBus service

Returns:

[] if the name of the plugin is loaded

Return type:

list of str

class blivet.tasks.availability.ExternalResource(method, name)

Bases: object

An external resource.

Initializes an instance of an external resource.

Parameters:
  • method (Method) – A method object

  • name (str) – the name of the external resource

property availability_errors

Whether the resource has any availability errors.

Returns:

[] if the resource is available

Return type:

list of str

property available

Whether the resource is available.

Returns:

True if the resource is available

Return type:

bool

class blivet.tasks.availability.FSOperation

Bases: object

INFO = 3
LABEL = 1
MKFS = 4
RESIZE = 2
UUID = 0
class blivet.tasks.availability.Method

Bases: object

Method for determining if external resource is available.

abstract availability_errors(resource)

Returns [] if the resource is available.

Parameters:

resource (ExternalResource) – any external resource

Returns:

[] if the external resource is available

Return type:

list of str

class blivet.tasks.availability.VersionMethod(version_info=None)

Bases: Method

Methods for checking the version of the external resource.

Initializer.

:param AppVersionInfo version_info:

availability_errors(resource)

Returns [] if the resource is available.

Parameters:

resource (ExternalResource) – any external resource

Returns:

[] if the external resource is available

Return type:

list of str

blivet.tasks.availability.application(name)

Construct an external resource that is an application.

This application will be available if its name can be found in $PATH.

blivet.tasks.availability.application_by_version(name, version_method)

Construct an external resource that is an application.

This application will be available if its name can be found in $PATH AND its version is at least the required version.

:param VersionMethod version_method: the version method

blivet.tasks.availability.available_resource(name)

Construct an external resource that is always available.

blivet.tasks.availability.blockdev_fs_plugin_operation(blockdev_fs_method)

Construct an external resource that is a libblockdev FS plugin functionality.

blivet.tasks.availability.blockdev_plugin(name, blockdev_method)

Construct an external resource that is a libblockdev plugin.

blivet.tasks.availability.dbus_service(name, dbus_method)

Construct an external resource that is a DBus service.

blivet.tasks.availability.unavailable_resource(name)

Construct an external resource that is always unavailable.

blivet.tasks.dfresize module

class blivet.tasks.dfresize.DFResizeTask

Bases: Task

The abstract properties that any resize task must have.

abstract property unit

Resize unit.

class blivet.tasks.dfresize.UnimplementedDFResize(a_df)

Bases: UnimplementedTask, DFResizeTask

Initializer.

Parameters:

a_df (DeviceFormat) – a device format object

property unit

Resize unit.

blivet.tasks.fsck module

class blivet.tasks.fsck.DosFSCK(an_fs)

Bases: FSCK

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
options = ['-n']
class blivet.tasks.fsck.Ext2FSCK(an_fs)

Bases: FSCK

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
options = ['-f', '-p']
class blivet.tasks.fsck.F2FSFSCK(an_fs)

Bases: FSCK

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
options = ['-a']
class blivet.tasks.fsck.FSCK(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents actions associated with checking consistency of a filesystem.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'fsck'
do_task()

Check the filesystem.

Raises:

FSError – on failure

abstract property options

Options for invoking the application.

class blivet.tasks.fsck.HFSPlusFSCK(an_fs)

Bases: FSCK

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
options = []
class blivet.tasks.fsck.NTFSFSCK(an_fs)

Bases: FSCK

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
options = ['-c']
class blivet.tasks.fsck.UnimplementedFSCK(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsck.XFSCK(an_fs)

Bases: FSCK

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
options = []

blivet.tasks.fsinfo module

class blivet.tasks.fsinfo.Ext2FSInfo(an_fs)

Bases: FSInfo

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
class blivet.tasks.fsinfo.FSInfo(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents an information gathering app.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'filesystem info'
do_task()

Returns information from the command.

Returns:

a string representing the output of the command

Return type:

str

Raises:

FSError – if info cannot be obtained

class blivet.tasks.fsinfo.NTFSInfo(an_fs)

Bases: FSInfo

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
class blivet.tasks.fsinfo.UnimplementedFSInfo(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsinfo.XFSInfo(an_fs)

Bases: FSInfo

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>

blivet.tasks.fslabeling module

class blivet.tasks.fslabeling.Ext2FSLabeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.F2FSLabeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.FATFSLabeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.FSLabeling

Bases: object

An abstract class that represents filesystem labeling actions.

abstract classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.GFS2Labeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.HFSPlusLabeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.NTFSLabeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

class blivet.tasks.fslabeling.XFSLabeling

Bases: FSLabeling

classmethod label_format_ok(label)

Returns True if this label is correctly formatted for this filesystem, otherwise False.

Parameters:

label (str) – the label for this filesystem

Return type:

bool

blivet.tasks.fsminsize module

class blivet.tasks.fsminsize.Ext2FSMinSize(an_fs)

Bases: FSMinSize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property depends_on

tasks that this task depends on

do_task()

Returns the minimum size for this filesystem object.

Return type:

Size

Returns:

the minimum size

Raises:

FSError – if filesystem can not be obtained

ext = <blivet.tasks.availability.ExternalResource object>
options = ['-P']
class blivet.tasks.fsminsize.FSMinSize(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents min size information extraction.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'minimum filesystem size'
abstract do_task()

Returns the minimum size for this filesystem object.

Return type:

Size

Returns:

the minimum size

Raises:

FSError – if filesystem can not be obtained

abstract property options

Options for use with app.

class blivet.tasks.fsminsize.NTFSMinSize(an_fs)

Bases: FSMinSize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

do_task()

Returns the minimum size for this filesystem object.

Return type:

Size

Returns:

the minimum size

Raises:

FSError – if filesystem can not be obtained

ext = <blivet.tasks.availability.ExternalResource object>
options = ['-m']
class blivet.tasks.fsminsize.UnimplementedFSMinSize(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

blivet.tasks.fsmkfs module

class blivet.tasks.fsmkfs.BTRFSMkfs(an_fs)

Bases: FSBlockDevMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = False
can_nodiscard = True
can_set_uuid = True
ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'btrfs'
class blivet.tasks.fsmkfs.Ext2FSMkfs(an_fs)

Bases: FSBlockDevMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = True
can_nodiscard = True
can_set_uuid = True
ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'ext2'
class blivet.tasks.fsmkfs.Ext3FSMkfs(an_fs)

Bases: Ext2FSMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

fstype = 'ext3'
class blivet.tasks.fsmkfs.Ext4FSMkfs(an_fs)

Bases: Ext2FSMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

fstype = 'ext4'
class blivet.tasks.fsmkfs.F2FSMkfs(an_fs)

Bases: FSBlockDevMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = True
can_nodiscard = True
can_set_uuid = False
ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'f2fs'
class blivet.tasks.fsmkfs.FATFSMkfs(an_fs)

Bases: FSBlockDevMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = True
can_nodiscard = False
can_set_uuid = True
ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'vfat'
class blivet.tasks.fsmkfs.FSBlockDevMkfs(an_fs)

Bases: BasicApplication, FSMkfsTask

An abstract class that represents filesystem creation actions.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = False
can_nodiscard = False
can_set_uuid = False
description = 'mkfs'
do_task(options=None, label=False, set_uuid=False, nodiscard=False)

Create the format on the device and label if possible and desired.

Parameters:
  • options (list of str or NoneType) – any special options, may be None

  • label (bool) – whether to label while creating, default is False

  • set_uuid (bool) – whether to set an UUID while creating, default is False

fstype = None
class blivet.tasks.fsmkfs.FSMkfs(an_fs)

Bases: BasicApplication, FSMkfsTask

An abstract class that represents filesystem creation actions.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

abstract property args

options for creating filesystem

property can_label

Whether this task can label the filesystem.

Returns:

True if this task can label the filesystem

Return type:

bool

property can_nodiscard

Whether this task can set nodiscard option for a filesystem.

Returns:

True if nodiscard can be set

Return type:

bool

property can_set_uuid

Whether this task can set the UUID of a filesystem.

Returns:

True if UUID can be set

Return type:

bool

description = 'mkfs'
do_task(options=None, label=False, set_uuid=False, nodiscard=False)

Create the format on the device and label if possible and desired.

Parameters:
  • options (list of str or NoneType) – any special options, may be None

  • label (bool) – whether to label while creating, default is False

  • set_uuid (bool) – whether to set an UUID while creating, default is False

abstract get_uuid_args(uuid)

Return a list of arguments for setting a filesystem UUID.

Parameters:

uuid (str) – the UUID to set

Return type:

list of str

abstract property label_option

Option for setting a filesystem label.

abstract property nodiscard_option

Option for setting nodiscrad option for mkfs.

class blivet.tasks.fsmkfs.FSMkfsTask(an_fs)

Bases: FSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

abstract property can_label

whether this task labels

abstract property can_nodiscard

whether this task can set nodiscard option

abstract property can_set_uuid

whether this task can set UUID

class blivet.tasks.fsmkfs.GFS2Mkfs(an_fs)

Bases: FSMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property args

options for creating filesystem

ext = <blivet.tasks.availability.ExternalResource object>
get_uuid_args = None
label_option = '-t'
nodiscard_option = None
class blivet.tasks.fsmkfs.HFSPlusMkfs(an_fs)

Bases: FSMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property args

options for creating filesystem

ext = <blivet.tasks.availability.ExternalResource object>
get_uuid_args = None
label_option = '-v'
nodiscard_option = None
class blivet.tasks.fsmkfs.NTFSMkfs(an_fs)

Bases: FSBlockDevMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = True
can_nodiscard = False
can_set_uuid = False
ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'ntfs'
class blivet.tasks.fsmkfs.UnimplementedFSMkfs(an_fs)

Bases: UnimplementedTask, FSMkfsTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property can_label

whether this task labels

property can_nodiscard

whether this task can set nodiscard option

property can_set_uuid

whether this task can set UUID

class blivet.tasks.fsmkfs.XFSMkfs(an_fs)

Bases: FSBlockDevMkfs

Initializer.

Parameters:

an_fs (FS) – a filesystem object

can_label = True
can_nodiscard = True
can_set_uuid = True
ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'xfs'

blivet.tasks.fsmount module

class blivet.tasks.fsmount.BindFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsmount.DevPtsFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

options = ['gid=5', 'mode=620']
class blivet.tasks.fsmount.EFIFSMount(an_fs)

Bases: FATFSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

fstype = 'vfat'
class blivet.tasks.fsmount.FATFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

options = ['umask=0077', 'shortname=winnt']
class blivet.tasks.fsmount.FSMount(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents filesystem mounting actions.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'mount a filesystem'
do_task(mountpoint, options=None)

Create the format on the device and label if possible and desired.

Parameters:
  • mountpoint (str) – mountpoint that overrides self.mountpoint

  • options (str or None) – mount options

ext = <blivet.tasks.availability.ExternalResource object>
fstype = None
mount_options(options)

The options used for mounting.

Parameters:

options (str or NoneType) – mount options

Returns:

the options used by the task

Return type:

str

property mount_type

Mount type string to pass to mount command.

Returns:

mount type string

Return type:

str

options = ['defaults']
class blivet.tasks.fsmount.HFSPlusMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

fstype = 'hfsplus'
class blivet.tasks.fsmount.Iso9660FSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

options = ['ro']
class blivet.tasks.fsmount.NFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsmount.NTFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

options = ['default', 'ro']
class blivet.tasks.fsmount.NoDevFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property mount_type

Mount type string to pass to mount command.

Returns:

mount type string

Return type:

str

class blivet.tasks.fsmount.SELinuxFSMount(an_fs)

Bases: NoDevFSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsmount.StratisXFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

fstype = 'xfs'
class blivet.tasks.fsmount.TmpFSMount(an_fs)

Bases: NoDevFSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsmount.UDFFSMount(an_fs)

Bases: FSMount

Initializer.

Parameters:

an_fs (FS) – a filesystem object

options = ['ro']

blivet.tasks.fsreadlabel module

class blivet.tasks.fsreadlabel.DosFSReadLabel(an_fs)

Bases: FSReadLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
class blivet.tasks.fsreadlabel.Ext2FSReadLabel(an_fs)

Bases: FSReadLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
class blivet.tasks.fsreadlabel.FSReadLabel(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents reading a filesystem’s label.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property depends_on

tasks that this task depends on

description = 'read filesystem label'
do_task()

Get the label.

Returns:

the filesystem label

Return type:

str

class blivet.tasks.fsreadlabel.NTFSReadLabel(an_fs)

Bases: FSReadLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
class blivet.tasks.fsreadlabel.UnimplementedFSReadLabel(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsreadlabel.XFSReadLabel(an_fs)

Bases: FSReadLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>

blivet.tasks.fsresize module

class blivet.tasks.fsresize.Ext2FSResize(an_fs)

Bases: FSResize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
unit = 2
class blivet.tasks.fsresize.FSResize(an_fs)

Bases: BasicApplication, FSResizeTask

An abstract class for resizing a filesystem.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'resize filesystem'
do_task()

Resize the device.

Raises:

FSError – on failure

class blivet.tasks.fsresize.FSResizeTask(an_fs)

Bases: FSTask

The abstract properties that any resize task must have.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fsresize.NTFSResize(an_fs)

Bases: FSResize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
unit = 0
class blivet.tasks.fsresize.TmpFSResize(an_fs)

Bases: FSResize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

do_task()

Resize the device.

Raises:

FSError – on failure

ext = <blivet.tasks.availability.ExternalResource object>
unit = 2
class blivet.tasks.fsresize.UnimplementedFSResize(a_df)

Bases: UnimplementedDFResize, FSResizeTask

Initializer.

Parameters:

a_df (DeviceFormat) – a device format object

unit = 0
class blivet.tasks.fsresize.XFSResize(an_fs)

Bases: FSResize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
unit = 0

blivet.tasks.fssize module

class blivet.tasks.fssize.Ext2FSSize(an_fs)

Bases: FSSize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fssize.FSSize(an_fs)

Bases: FSTask

An abstract class that represents size information extraction.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property depends_on

tasks that this task depends on

description = 'current filesystem size'
do_task()

Returns the size of the filesystem.

Returns:

the size of the filesystem

Return type:

Size

Raises:

FSError – on failure

class blivet.tasks.fssize.NTFSSize(an_fs)

Bases: FSSize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fssize.TmpFSSize(an_fs)

Bases: FSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

property depends_on

tasks that this task depends on

description = 'current filesystem size'
do_task()

Do the task for this class.

class blivet.tasks.fssize.UnimplementedFSSize(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fssize.XFSSize(an_fs)

Bases: FSSize

Initializer.

Parameters:

an_fs (FS) – a filesystem object

blivet.tasks.fssync module

class blivet.tasks.fssync.FSSync(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents syncing a filesystem.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'filesystem syncing'
abstract do_task()

Do the task for this class.

class blivet.tasks.fssync.UnimplementedFSSync(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fssync.XFSSync(an_fs)

Bases: FSSync

Sync application for XFS.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

do_task(root='/')

Do the task for this class.

ext = <blivet.tasks.availability.ExternalResource object>

blivet.tasks.fstask module

class blivet.tasks.fstask.FSTask(an_fs)

Bases: Task

An abstract class that encapsulates the fact that all FSTasks have a single master object: the filesystem that they belong to.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'parent of all filesystem tasks'
class blivet.tasks.fstask.UnimplementedFSTask(an_fs)

Bases: FSTask, UnimplementedTask

A convenience class for unimplemented filesystem tasks. Useful in the usual case where an Unimplemented task has no special methods that it is required to implement.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

blivet.tasks.fsuuid module

class blivet.tasks.fsuuid.Ext2FSUUID

Bases: FSUUID

classmethod uuid_format_ok(uuid)

Returns True if the given UUID is correctly formatted for this filesystem, otherwise False.

Parameters:

uuid (str) – the UUID for this filesystem

Return type:

bool

class blivet.tasks.fsuuid.FATFSUUID

Bases: FSUUID

classmethod uuid_format_ok(uuid)

Returns True if the given UUID is correctly formatted for this filesystem, otherwise False.

Parameters:

uuid (str) – the UUID for this filesystem

Return type:

bool

class blivet.tasks.fsuuid.FSUUID

Bases: object

An abstract class that represents filesystem actions for setting the UUID.

abstract classmethod uuid_format_ok(uuid)

Returns True if the given UUID is correctly formatted for this filesystem, otherwise False.

Parameters:

uuid (str) – the UUID for this filesystem

Return type:

bool

class blivet.tasks.fsuuid.HFSPlusUUID

Bases: FSUUID

classmethod uuid_format_ok(uuid)

Returns True if the given UUID is correctly formatted for this filesystem, otherwise False.

Parameters:

uuid (str) – the UUID for this filesystem

Return type:

bool

class blivet.tasks.fsuuid.NTFSUUID

Bases: FSUUID

classmethod uuid_format_ok(uuid)

Returns True if the given UUID is correctly formatted for this filesystem, otherwise False.

Parameters:

uuid (str) – the UUID for this filesystem

Return type:

bool

class blivet.tasks.fsuuid.XFSUUID

Bases: FSUUID

classmethod uuid_format_ok(uuid)

Returns True if the given UUID is correctly formatted for this filesystem, otherwise False.

Parameters:

uuid (str) – the UUID for this filesystem

Return type:

bool

blivet.tasks.fswritelabel module

class blivet.tasks.fswritelabel.DosFSWriteLabel(an_fs)

Bases: FSWriteLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'vfat'
class blivet.tasks.fswritelabel.Ext2FSWriteLabel(an_fs)

Bases: FSWriteLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'ext2'
class blivet.tasks.fswritelabel.FSWriteLabel(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents writing a label for a filesystem.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'write filesystem label'
do_task()

Do the task for this class.

fstype = None
class blivet.tasks.fswritelabel.NTFSWriteLabel(an_fs)

Bases: FSWriteLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'ntfs'
class blivet.tasks.fswritelabel.UnimplementedFSWriteLabel(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fswritelabel.XFSWriteLabel(an_fs)

Bases: FSWriteLabel

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'xfs'

blivet.tasks.fswriteuuid module

class blivet.tasks.fswriteuuid.Ext2FSWriteUUID(an_fs)

Bases: FSWriteUUID

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'ext2'
class blivet.tasks.fswriteuuid.FSWriteUUID(an_fs)

Bases: BasicApplication, FSTask

An abstract class that represents writing an UUID for a filesystem.

Initializer.

Parameters:

an_fs (FS) – a filesystem object

description = 'write filesystem UUID'
do_task()

Do the task for this class.

fstype = None
class blivet.tasks.fswriteuuid.NTFSWriteUUID(an_fs)

Bases: FSWriteUUID

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'ntfs'
class blivet.tasks.fswriteuuid.UnimplementedFSWriteUUID(an_fs)

Bases: UnimplementedFSTask

Initializer.

Parameters:

an_fs (FS) – a filesystem object

class blivet.tasks.fswriteuuid.XFSWriteUUID(an_fs)

Bases: FSWriteUUID

Initializer.

Parameters:

an_fs (FS) – a filesystem object

ext = <blivet.tasks.availability.ExternalResource object>
fstype = 'xfs'

blivet.tasks.lukstasks module

class blivet.tasks.lukstasks.LUKSResize(a_luks)

Bases: BasicApplication, DFResizeTask

Handle resize of LUKS device.

Initializer.

:param LUKS a_luks: a LUKS format object

description = 'resize luks device'
do_task()

Resizes the LUKS format.

ext = <blivet.tasks.availability.ExternalResource object>
unit = Size (512 B)
class blivet.tasks.lukstasks.LUKSSize(a_luks)

Bases: BasicApplication

Obtain information about the size of a LUKS format.

Initializer.

:param LUKS a_luks: a LUKS format object

description = 'size of a luks device'
do_task()

Returns the size of the luks format.

Returns:

the size of the luks format

Return type:

Size

:raises LUKSError: if size cannot be obtained

ext = <blivet.tasks.availability.ExternalResource object>

blivet.tasks.pvtask module

class blivet.tasks.pvtask.PVResize(a_pv)

Bases: BasicApplication, DFResizeTask

Handle resize of the LVMPV format.

Initializer.

:param LVMPhysicalVolume a_pv: a LVMPV format object

description = 'resize the LVMPV format'
do_task()

Resizes the LVMPV format.

ext = <blivet.tasks.availability.ExternalResource object>
unit = 0
class blivet.tasks.pvtask.PVSize(a_pv)

Bases: BasicApplication

Obtain information about the size of a LVMPV format.

Initializer.

:param LVMPhysicalVolume a_pv: a LVMPV format object

description = 'size of a LVMPV format'
do_task()

Returns the size of the LVMPV format.

Returns:

the size of the LVMPV format

Return type:

Size

:raises PhysicalVolumeError: if size cannot be obtained

ext = <blivet.tasks.availability.ExternalResource object>

blivet.tasks.task module

class blivet.tasks.task.BasicApplication

Bases: Task

A task representing an application.

property depends_on

tasks that this task depends on

abstract property ext

The object representing the external resource.

class blivet.tasks.task.Task

Bases: object

An abstract class that represents some task.

property availability_errors

Reasons if this task or the tasks it depends on are unavailable.

property available

True if the task is available, otherwise False.

Returns:

True if the task is available

Return type:

bool

abstract property depends_on

tasks that this task depends on

abstract property description

Brief description for this task.

abstract do_task(*args, **kwargs)

Do the task for this class.

implemented = True
class blivet.tasks.task.UnimplementedTask

Bases: Task

A null Task, which returns a negative or empty for all properties.

depends_on = []
description = 'an unimplemented task'
do_task(*args, **kwargs)

Do the task for this class.

implemented = False

Module contents