Package pyanaconda :: Package storage :: Module devices :: Class StorageDevice
[hide private]
[frames] | no frames]

Class StorageDevice

source code

object --+    
         |    
    Device --+
             |
            StorageDevice

A generic storage device.

A fully qualified path to the device node can be obtained via the path attribute, although it is not guaranteed to be useful, or even present, unless the StorageDevice's setup method has been run.

StorageDevice instances can optionally contain a filesystem, represented by an FS instance. A StorageDevice's create method should create a filesystem if one has been specified.

Instance Methods [hide private]
 
__init__(self, name, format=None, uuid=None, size=None, major=None, minor=None, sysfsPath='', parents=None, exists=None, serial=None, vendor="", model="", bus="")
Create a StorageDevice instance.
source code
 
__str__(self)
str(x)
source code
 
packages(self)
List of packages required to manage devices of this type.
source code
 
services(self)
List of services required to manage devices of this type.
source code
 
disks(self)
A list of all disks this device depends on, including itself.
source code
 
encrypted(self)
True if this device, or any it requires, is encrypted.
source code
 
partedDevice(self) source code
 
_getTargetSize(self) source code
 
_setTargetSize(self, newsize) source code
 
__repr__(self)
repr(x)
source code
 
dict(self) source code
 
path(self)
Device node representing this device.
source code
 
updateSysfsPath(self)
Update this device's sysfs path.
source code
 
formatArgs(self)
Device-specific arguments to format creation program.
source code
 
resizable(self)
Can this type of device be resized?
source code
 
notifyKernel(self)
Send a 'change' uevent to the kernel for this device.
source code
 
fstabSpec(self) source code
 
resize(self, intf=None)
Resize the device.
source code
 
_progressWindow(self, intf=None, title="", msg="") source code
 
_waitWindow(self, intf=None, title="", msg="") source code
 
_statusWindow(self, intf=None, title="", msg="") source code
 
_preSetup(self, orig=False)
Preparation and pre-condition checking for device setup.
source code
 
_setup(self, intf=None, orig=False)
Perform device-specific setup operations.
source code
 
setup(self, intf=None, orig=False)
Open, or set up, a device.
source code
 
_postSetup(self)
Perform post-setup operations.
source code
 
_preTeardown(self, recursive=None)
Preparation and pre-condition checking for device teardown.
source code
 
_teardown(self, recursive=None)
Perform device-specific teardown operations.
source code
 
teardown(self, recursive=None)
Close, or tear down, a device.
source code
 
_postTeardown(self, recursive=None)
Perform post-teardown operations.
source code
 
_preCreate(self)
Preparation and pre-condition checking for device creation.
source code
 
_create(self, w)
Perform device-specific create operations.
source code
 
create(self, intf=None)
Create the device.
source code
 
_postCreate(self)
Perform post-create operations.
source code
 
_preDestroy(self)
Preparation and precondition checking for device destruction.
source code
 
_destroy(self)
Perform device-specific destruction operations.
source code
 
destroy(self)
Destroy the device.
source code
 
_postDestroy(self)
Perform post-destruction operations.
source code
 
setupParents(self, orig=False)
Run setup method of all parent devices.
source code
 
_getSize(self)
Get the device's size in MB, accounting for pending changes.
source code
 
_setSize(self, newsize)
Set the device's size to a new value.
source code
 
currentSize(self)
The device's actual size.
source code
 
minSize(self)
The minimum size this device can be.
source code
 
maxSize(self)
The maximum size this device can be.
source code
 
status(self)
This device's status.
source code
 
_setFormat(self, format)
Set the Device's format.
source code
 
_getFormat(self) source code
 
preCommitFixup(self, *args, **kwargs)
Do any necessary pre-commit fixups.
source code
 
removable(self) source code
 
isDisk(self) source code
 
partitionable(self) source code
 
partitioned(self) source code
 
serial(self) source code
 
model(self) source code
 
vendor(self) source code
 
growable(self)
True if this device or it's component devices are growable.
source code
 
checkSize(self)
Check to make sure the size of the device is allowed by the format used.
source code

Inherited from Device: __deepcopy__, addChild, dependsOn, dracutSetupArgs, isleaf, mediaPresent, name, removeChild, teardownParents, type, typeDescription, writeKS

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

Class Variables [hide private]
  _type = "storage"
  _devDir = "/dev"
  sysfsBlockDir = "class/block"
  _resizable = False
  _partitionable = False
  _isDisk = False
  targetSize = property(lambda s: s._getTargetSize(), lambda s, ...
  size = property(lambda x: x._getSize(), lambda x, y: x._setSiz...
  format = property(lambda d: d._getFormat(), lambda d, f: d._se...

Inherited from Device (private): _id, _packages, _services

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, format=None, uuid=None, size=None, major=None, minor=None, sysfsPath='', parents=None, exists=None, serial=None, vendor="", model="", bus="")
(Constructor)

source code 
Create a StorageDevice instance.

Arguments:

    name -- the device name (generally a device node's basename)

Keyword Arguments:

    size -- the device's size (units/format TBD)
    major -- the device major
    minor -- the device minor
    sysfsPath -- sysfs device path
    format -- a DeviceFormat instance
    uuid -- universally unique identifier
    parents -- a list of required Device instances
    serial -- the ID_SERIAL_SHORT for this device
    vendor -- the manufacturer of this Device
    model -- manufacturer's device model string
    bus -- the interconnect this device uses

Overrides: object.__init__

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

packages(self)

source code 

List of packages required to manage devices of this type.

This list includes the packages required by this device's format type as well those required by all of its parent devices.

Decorators:
  • @property
Overrides: Device.packages

services(self)

source code 

List of services required to manage devices of this type.

This list includes the services required by this device's format type as well those required by all of its parent devices.

Decorators:
  • @property
Overrides: Device.services

disks(self)

source code 

A list of all disks this device depends on, including itself.

Decorators:
  • @property

encrypted(self)

source code 

True if this device, or any it requires, is encrypted.

Decorators:
  • @property

partedDevice(self)

source code 
Decorators:
  • @property

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

dict(self)

source code 
Decorators:
  • @property
Overrides: Device.dict

path(self)

source code 

Device node representing this device.

Decorators:
  • @property

formatArgs(self)

source code 

Device-specific arguments to format creation program.

Decorators:
  • @property

resizable(self)

source code 

Can this type of device be resized?

Decorators:
  • @property

fstabSpec(self)

source code 
Decorators:
  • @property

resize(self, intf=None)

source code 

Resize the device.

New size should already be set.

_preSetup(self, orig=False)

source code 

Preparation and pre-condition checking for device setup.

Return True if setup should proceed or False if not.

setup(self, intf=None, orig=False)

source code 

Open, or set up, a device.

Overrides: Device.setup

_preTeardown(self, recursive=None)

source code 

Preparation and pre-condition checking for device teardown.

Return True if teardown should proceed or False if not.

teardown(self, recursive=None)

source code 

Close, or tear down, a device.

Overrides: Device.teardown

create(self, intf=None)

source code 

Create the device.

Overrides: Device.create

destroy(self)

source code 

Destroy the device.

Overrides: Device.destroy

setupParents(self, orig=False)

source code 

Run setup method of all parent devices.

Overrides: Device.setupParents

currentSize(self)

source code 

The device's actual size.

Decorators:
  • @property

minSize(self)

source code 

The minimum size this device can be.

Decorators:
  • @property

maxSize(self)

source code 

The maximum size this device can be.

Decorators:
  • @property

status(self)

source code 
This device's status.

For now, this should return a boolean:
    True    the device is open and ready for use
    False   the device is not open

Decorators:
  • @property
Overrides: Device.status

removable(self)

source code 
Decorators:
  • @property

isDisk(self)

source code 
Decorators:
  • @property

partitionable(self)

source code 
Decorators:
  • @property

partitioned(self)

source code 
Decorators:
  • @property

serial(self)

source code 
Decorators:
  • @property

model(self)

source code 
Decorators:
  • @property

vendor(self)

source code 
Decorators:
  • @property

growable(self)

source code 

True if this device or it's component devices are growable.

Decorators:
  • @property

checkSize(self)

source code 

Check to make sure the size of the device is allowed by the format used.

Returns: 0 - ok 1 - Too large -1 - Too small


Class Variable Details [hide private]

targetSize

Value:
property(lambda s: s._getTargetSize(), lambda s, v: s._setTargetSize(v\
), doc= "Target size of this device")

size

Value:
property(lambda x: x._getSize(), lambda x, y: x._setSize(y), doc= "The\
 device's size in MB, accounting for pending changes")

format

Value:
property(lambda d: d._getFormat(), lambda d, f: d._setFormat(f), doc= \
"The device's formatting.")