Package pyanaconda :: Package storage :: Class Storage
[hide private]
[frames] | no frames]

Class Storage

source code

object --+
         |
        Storage

Instance Methods [hide private]
 
__init__(self, anaconda=None, intf=None, platform=None)
Create a Storage instance.
source code
 
doIt(self) source code
 
nextID(self) source code
 
shutdown(self) source code
 
reset(self, cleanupOnly=False)
Reset storage configuration to reflect actual system state.
source code
 
devices(self)
A list of all the devices in the device tree.
source code
 
disks(self)
A list of the disks in the device tree.
source code
 
partitioned(self)
A list of the partitioned devices in the device tree.
source code
 
partitions(self)
A list of the partitions in the device tree.
source code
 
vgs(self)
A list of the LVM Volume Groups in the device tree.
source code
 
lvs(self)
A list of the LVM Logical Volumes in the device tree.
source code
 
pvs(self)
A list of the LVM Physical Volumes in the device tree.
source code
 
unusedPVs(self, vg=None) source code
 
mdarrays(self)
A list of the MD arrays in the device tree.
source code
 
mdcontainers(self)
A list of the MD containers in the device tree.
source code
 
mdmembers(self)
A list of the MD member devices in the device tree.
source code
 
unusedMDMembers(self, array=None) source code
 
unusedMDMinors(self)
Return a list of unused minors for use in RAID.
source code
 
btrfsVolumes(self) source code
 
swaps(self)
A list of the swap devices in the device tree.
source code
 
protectedDevices(self) source code
 
liveImage(self)
The OS image used by live installs.
source code
 
intf(self) source code
 
platform(self) source code
 
names(self) source code
 
exceptionDisks(self)
Return a list of removable devices to save exceptions to.
source code
 
deviceImmutable(self, device, ignoreProtected=False)
Return any reason the device cannot be modified/removed.
source code
 
deviceDeps(self, device) source code
 
newPartition(self, *args, **kwargs)
Return a new PartitionDevice instance for configuring.
source code
 
newMDArray(self, *args, **kwargs)
Return a new MDRaidArrayDevice instance for configuring.
source code
 
newVG(self, *args, **kwargs)
Return a new LVMVolumeGroupDevice instance.
source code
 
newLV(self, *args, **kwargs)
Return a new LVMLogicalVolumeDevice instance.
source code
 
newBTRFS(self, *args, **kwargs)
Return a new BTRFSVolumeDevice or BRFSSubVolumeDevice.
source code
 
createDevice(self, device)
Schedule creation of a device.
source code
 
destroyDevice(self, device)
Schedule destruction of a device.
source code
 
formatDevice(self, device, format)
Schedule formatting of a device.
source code
 
formatByDefault(self, device)
Return whether the device should be reformatted by default.
source code
 
mustFormat(self, device)
Return a string explaining why the device must be reformatted.
source code
 
extendedPartitionsSupported(self)
Return whether any disks support extended partitions.
source code
 
safeDeviceName(self, name)
Convert a device name to something safe and return that.
source code
 
suggestContainerName(self, hostname=None, prefix="")
Return a reasonable, unused device name.
source code
 
suggestDeviceName(self, parent=None, swap=None, mountpoint=None, prefix="")
Return a suitable, unused name for a new logical volume.
source code
 
doEncryptionPassphraseRetrofits(self)
Add the global passphrase to all preexisting LUKS devices.
source code
 
setupDiskImages(self) source code
 
sanityCheck(self)
Run a series of tests to verify the storage configuration.
source code
 
isProtected(self, device)
Return True is the device is protected.
source code
 
checkNoDisks(self)
Check that there are valid disk devices.
source code
 
dumpState(self, suffix)
Dump the current device list to the storage shelf.
source code
 
write(self) source code
 
writeKS(self, f) source code
 
turnOnSwap(self, upgrading=None) source code
 
mountFilesystems(self, raiseErrors=None, readOnly=None, skipRoot=False) source code
 
umountFilesystems(self, ignoreErrors=True, swapoff=True) source code
 
parseFSTab(self, anaconda=None, chroot=None) source code
 
mkDevRoot(self) source code
 
createSwapFile(self, device, size) source code
 
bootDevice(self) source code
 
bootLoaderDevice(self) source code
 
bootFSTypes(self)
A list of all valid filesystem types for the boot partition.
source code
 
defaultBootFSType(self)
The default filesystem type for the boot partition.
source code
 
mountpoints(self) source code
 
migratableDevices(self) source code
 
rootDevice(self) source code
 
makeMtab(self) source code
 
compareDisks(self, first, second) 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, anaconda=None, intf=None, platform=None)
(Constructor)

source code 
Create a Storage instance.

Keyword Arguments:

    anaconda    -   an Anaconda instance
    intf        -   an InstallInterface instance
    platform    -   a Platform instance

All arguments are optional. An Anaconda instance will contain
an InstallInterface and a Platform instance, so it makes sense
to pass in either an Anaconda instance or as many of the other
two as is desired. Explicitly passed intf or platform will take
precedence over those in the Anaconda instance.

Overrides: object.__init__

nextID(self)

source code 
Decorators:
  • @property

reset(self, cleanupOnly=False)

source code 

Reset storage configuration to reflect actual system state.

This should rescan from scratch but not clobber user-obtained information like passphrases, iscsi config, &c

devices(self)

source code 

A list of all the devices in the device tree.

Decorators:
  • @property

disks(self)

source code 

A list of the disks in the device tree.

Ignored disks are not included, as are disks with no media present.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

partitioned(self)

source code 

A list of the partitioned devices in the device tree.

Ignored devices are not included, nor disks with no media present.

Devices of types for which partitioning is not supported are also not included.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

partitions(self)

source code 

A list of the partitions in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

vgs(self)

source code 

A list of the LVM Volume Groups in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

lvs(self)

source code 

A list of the LVM Logical Volumes in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

pvs(self)

source code 

A list of the LVM Physical Volumes in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

mdarrays(self)

source code 

A list of the MD arrays in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

mdcontainers(self)

source code 

A list of the MD containers in the device tree.

Decorators:
  • @property

mdmembers(self)

source code 

A list of the MD member devices in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

unusedMDMinors(self)

source code 

Return a list of unused minors for use in RAID.

Decorators:
  • @property

btrfsVolumes(self)

source code 
Decorators:
  • @property

swaps(self)

source code 

A list of the swap devices in the device tree.

This is based on the current state of the device tree and does not necessarily reflect the actual on-disk state of the system's disks.

Decorators:
  • @property

protectedDevices(self)

source code 
Decorators:
  • @property

liveImage(self)

source code 

The OS image used by live installs.

Decorators:
  • @property

intf(self)

source code 
Decorators:
  • @property

platform(self)

source code 
Decorators:
  • @property

names(self)

source code 
Decorators:
  • @property

exceptionDisks(self)

source code 
Return a list of removable devices to save exceptions to.

FIXME: This raises the problem that the device tree can be
       in a state that does not reflect that actual current
       state of the system at any given point.

       We need a way to provide direct scanning of disks,
       partitions, and filesystems without relying on the
       larger objects' correctness.

       Also, we need to find devices that have just been made
       available for the purpose of storing the exception
       report.

deviceImmutable(self, device, ignoreProtected=False)

source code 

Return any reason the device cannot be modified/removed.

Return False if the device can be removed.

Devices that cannot be removed include:

  • protected partitions
  • devices that are part of an md array or lvm vg
  • extended partition containing logical partitions that meet any of the above criteria

createDevice(self, device)

source code 
Schedule creation of a device.

TODO: We could do some things here like assign the next
      available raid minor if one isn't already set.

mustFormat(self, device)

source code 

Return a string explaining why the device must be reformatted.

Return None if the device need not be reformatted.

safeDeviceName(self, name)

source code 

Convert a device name to something safe and return that.

LVM limits lv names to 128 characters. I don't know the limits for the other various device types, so I'm going to pick a number so that we don't have to have an entire fucking library to determine device name limits.

doEncryptionPassphraseRetrofits(self)

source code 

Add the global passphrase to all preexisting LUKS devices.

This establishes a common passphrase for all encrypted devices in the system so that users only have to enter one passphrase during system boot.

sanityCheck(self)

source code 

Run a series of tests to verify the storage configuration.

This function is called at the end of partitioning so that we can make sure you don't have anything silly (like no /, a really small /, etc). Returns (errors, warnings) where each is a list of strings.

bootDevice(self)

source code 
Decorators:
  • @property

bootLoaderDevice(self)

source code 
Decorators:
  • @property

bootFSTypes(self)

source code 

A list of all valid filesystem types for the boot partition.

Decorators:
  • @property

defaultBootFSType(self)

source code 

The default filesystem type for the boot partition.

Decorators:
  • @property

mountpoints(self)

source code 
Decorators:
  • @property

migratableDevices(self)

source code 
Decorators:
  • @property

rootDevice(self)

source code 
Decorators:
  • @property