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

Class Device

source code

object --+
         |
        Device

A generic device.

Device instances know which devices they depend upon (parents
attribute). They do not know which devices depend upon them, but
they do know whether or not they have any dependent devices
(isleaf attribute).

A Device's setup method should set up all parent devices as well
as the device itself. It should not run the resident format's
setup method.

    Which Device types rely on their parents' formats being active?
        DMCryptDevice

A Device's teardown method should accept the keyword argument
recursive, which takes a boolean value and indicates whether or
not to recursively close parent devices.

A Device's create method should create all parent devices as well
as the device itself. It should also run the Device's setup method
after creating the device. The create method should not create a
device's resident format.

    Which device type rely on their parents' formats to be created
    before they can be created/assembled?
        VolumeGroup
        DMCryptDevice

A Device's destroy method should destroy any resident format
before destroying the device itself.

Instance Methods [hide private]
 
__init__(self, name, parents=None)
Create a Device instance.
source code
 
__deepcopy__(self, memo)
Create a deep copy of a Device instance.
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code
 
dict(self) source code
 
writeKS(self, f, preexisting=False, noformat=False, s=None) source code
 
removeChild(self) source code
 
addChild(self) source code
 
setup(self, intf=None)
Open, or set up, a device.
source code
 
teardown(self, recursive=None)
Close, or tear down, a device.
source code
 
create(self, intf=None)
Create the device.
source code
 
destroy(self)
Destroy the device.
source code
 
setupParents(self, orig=False)
Run setup method of all parent devices.
source code
 
teardownParents(self, recursive=None)
Run teardown method of all parent devices.
source code
 
dependsOn(self, dep)
Return True if this device depends on dep.
source code
 
dracutSetupArgs(self) source code
 
status(self)
This device's status.
source code
 
name(self)
This device's name.
source code
 
isleaf(self)
True if this device has no children.
source code
 
typeDescription(self)
String describing the device type.
source code
 
type(self)
Device type.
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
 
mediaPresent(self) source code

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

Class Variables [hide private]
  _id = 0
  _type = "device"
  _packages = []
  _services = []
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, name, parents=None)
(Constructor)

source code 
Create a Device instance.

Arguments:

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

Keyword Arguments:

    parents -- a list of required Device instances

Overrides: object.__init__

__deepcopy__(self, memo)

source code 

Create a deep copy of a Device instance.

We can't do copy.deepcopy on parted objects, which is okay. For these parted objects, we just do a shallow copy.

__repr__(self)
(Representation operator)

source code 

repr(x)

Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 

str(x)

Overrides: object.__str__
(inherited documentation)

dict(self)

source code 
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

name(self)

source code 

This device's name.

Decorators:
  • @property

isleaf(self)

source code 

True if this device has no children.

Decorators:
  • @property

typeDescription(self)

source code 

String describing the device type.

Decorators:
  • @property

type(self)

source code 

Device type.

Decorators:
  • @property

packages(self)

source code 

List of packages required to manage devices of this type.

This list includes the packages required by its parent devices.

Decorators:
  • @property

services(self)

source code 

List of services required to manage devices of this type.

This list includes the services required by its parent devices."

Decorators:
  • @property

mediaPresent(self)

source code 
Decorators:
  • @property