Package pyanaconda :: Package storage :: Module devicetree :: Class DeviceTree
[hide private]
[frames] | no frames]

Class DeviceTree

source code

object --+
         |
        DeviceTree

A quasi-tree that represents the devices in the system.

The tree contains a list of device instances, which does not necessarily reflect the actual state of the system's devices. DeviceActions are used to perform modifications to the tree, except when initially populating the tree.

DeviceAction instances are registered, possibly causing the addition or removal of Device instances to/from the tree. The DeviceActions are all reversible up to the time their execute method has been called.

Only one action of any given type/object pair should exist for any given device at any given time.

DeviceAction instances can only be registered for leaf devices, except for resize actions.

Instance Methods [hide private]
 
__init__(self, intf=None, conf=None, passphrase=None, luksDict=None, iscsi=None, dasd=None)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
setDiskImages(self, images)
Set the disk images and reflect them in exclusiveDisks.
source code
 
addIgnoredDisk(self, disk) source code
 
pruneActions(self)
Remove redundant/obsolete actions from the action list.
source code
 
sortActions(self)
Sort actions based on dependencies.
source code
 
processActions(self, dryRun=None)
Execute all registered actions.
source code
 
_addDevice(self, newdev)
Add a device to the tree.
source code
 
_removeDevice(self, dev, force=None, moddisk=True)
Remove a device from the tree.
source code
 
registerAction(self, action)
Register an action to be performed at a later time.
source code
 
cancelAction(self, action)
Cancel a registered action.
source code
 
findActions(self, device=None, type=None, object=None, path=None, devid=None)
Find all actions that match all specified parameters.
source code
 
getDependentDevices(self, dep)
Return a list of devices that depend on dep.
source code
 
isIgnored(self, info)
Return True if info is a device we should ignore.
source code
 
addUdevLVDevice(self, info) source code
 
addUdevDMDevice(self, info) source code
 
addUdevMDDevice(self, info) source code
 
addUdevPartitionDevice(self, info, disk=None) source code
 
addUdevDiskDevice(self, info) source code
 
addUdevOpticalDevice(self, info) source code
 
addUdevLoopDevice(self, info) source code
 
addUdevDevice(self, info) source code
 
handleUdevDiskLabelFormat(self, info, device) source code
 
handleUdevLUKSFormat(self, info, device) source code
 
handleVgLvs(self, vg_device)
Handle setup of the LV's in the vg_device return True if an LV was setup return False if there was an error, or no more LV's to setup
source code
 
handleUdevLVMPVFormat(self, info, device) source code
 
handleUdevMDMemberFormat(self, info, device) source code
 
handleMultipathMemberFormat(self, info, device) source code
 
handleUdevDMRaidMemberFormat(self, info, device) source code
 
handleBTRFSFormat(self, info, device) source code
 
handleUdevDeviceFormat(self, info, device) source code
 
updateDeviceFormat(self, device) source code
 
_handleInconsistencies(self) source code
 
_recursiveRemove(self, device) source code
 
_setupLvs(self) source code
 
setupDiskImages(self)
Set up devices to represent the disk image files.
source code
 
backupConfigs(self, restore=False)
Create a backup copies of some storage config files.
source code
 
restoreConfigs(self) source code
 
populate(self, cleanupOnly=False, progressWindow=None)
Locate all storage devices.
source code
 
_populate(self, progressWindow) source code
 
teardownAll(self)
Run teardown methods on all devices.
source code
 
setupAll(self)
Run setup methods on all devices.
source code
 
getDeviceBySysfsPath(self, path) source code
 
getDeviceByUuid(self, uuid) source code
 
getDevicesBySerial(self, serial) source code
 
getDeviceByLabel(self, label) source code
 
getDeviceByName(self, name) source code
 
getDeviceByPath(self, path, preferLeaves=True) source code
 
getDevicesByType(self, device_type) source code
 
getDevicesByInstance(self, device_class) source code
 
devices(self)
List of device instances
source code
 
filesystems(self)
List of filesystems.
source code
 
uuids(self)
Dict with uuid keys and Device values.
source code
 
labels(self)
Dict with label keys and Device values.
source code
 
leaves(self)
List of all devices upon which no other devices exist.
source code
 
getChildren(self, device)
Return a list of a device's children.
source code
 
resolveDevice(self, devspec, blkidTab=None, cryptTab=None) source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, intf=None, conf=None, passphrase=None, luksDict=None, iscsi=None, dasd=None)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Overrides: object.__init__
(inherited documentation)

_addDevice(self, newdev)

source code 

Add a device to the tree.

Raise ValueError if the device's identifier is already in the list.

_removeDevice(self, dev, force=None, moddisk=True)

source code 

Remove a device from the tree.

Only leaves may be removed.

registerAction(self, action)

source code 

Register an action to be performed at a later time.

Modifications to the Device instance are handled before we get here.

cancelAction(self, action)

source code 

Cancel a registered action.

This will unregister the action and do any required modifications to the device list.

Actions all operate on a Device, so we can use the devices to determine dependencies.

findActions(self, device=None, type=None, object=None, path=None, devid=None)

source code 
Find all actions that match all specified parameters.

Keyword arguments:

    device -- device to match (Device, or None to match any)
    type -- action type to match (string, or None to match any)
    object -- operand type to match (string, or None to match any)
    path -- device path to match (string, or None to match any)

getDependentDevices(self, dep)

source code 

Return a list of devices that depend on dep.

The list includes both direct and indirect dependents.

isIgnored(self, info)

source code 
Return True if info is a device we should ignore.

Arguments:

    info -- a dict representing a udev db entry

TODO:

    - filtering of SAN/FC devices
    - filtering by driver?

devices(self)

source code 

List of device instances

Decorators:
  • @property

filesystems(self)

source code 

List of filesystems.

Decorators:
  • @property

uuids(self)

source code 

Dict with uuid keys and Device values.

Decorators:
  • @property

labels(self)

source code 

Dict with label keys and Device values.

FIXME: duplicate labels are a possibility

Decorators:
  • @property

leaves(self)

source code 

List of all devices upon which no other devices exist.

Decorators:
  • @property