Package CedarBackup2 :: Package writers :: Module util
[show private | hide private]
[frames | no frames]

Module CedarBackup2.writers.util

Provides utilities related to image writers.

Author: Kenneth J. Pronovici <pronovic@ieee.org>

Classes
IsoImage Represents an ISO filesystem image.

Function Summary
  readMediaLabel(devicePath)
Reads the media label (volume name) from the indicated device.
  validateDevice(device, unittest)
Validates a configured device.
  validateDriveSpeed(driveSpeed)
Validates a drive speed value.
  validateScsiId(scsiId)
Validates a SCSI id string.

Variable Summary
Logger logger = <logging.Logger instance at 0x402c46ac>
list MKISOFS_COMMAND = ['mkisofs']
list VOLNAME_COMMAND = ['volname']

Function Details

readMediaLabel(devicePath)

Reads the media label (volume name) from the indicated device. The volume name is read using the volname command.
Parameters:
devicePath - Device path to read from
Returns:
Media label as a string, or None if there is no name or it could not be read.

validateDevice(device, unittest=False)

Validates a configured device. The device must be an absolute path, must exist, and must be writable. The unittest flag turns off validation of the device on disk.
Parameters:
device - Filesystem device path.
unittest - Indicates whether we're unit testing.
Returns:
Device as a string, for instance "/dev/cdrw"
Raises:
ValueError - If the device value is invalid.
ValueError - If some path cannot be encoded properly.

validateDriveSpeed(driveSpeed)

Validates a drive speed value. Drive speed must be an integer which is >= 1.
Parameters:
driveSpeed - Speed at which the drive writes.
Returns:
Drive speed as an integer
Raises:
ValueError - If the drive speed value is invalid.

Note: For consistency, if None is passed in, None will be returned.

validateScsiId(scsiId)

Validates a SCSI id string. SCSI id must be a string in the form [<method>:]scsibus,target,lun. For Mac OS X (Darwin), we also accept the form IO.*Services[/N].
Parameters:
scsiId - SCSI id for the device.
Returns:
SCSI id as a string, for instance "ATA:1,0,0"
Raises:
ValueError - If the SCSI id string is invalid.

Note: For consistency, if None is passed in, None will be returned.


Variable Details

logger

Type:
Logger
Value:
<logging.Logger instance at 0x402c46ac>                                

MKISOFS_COMMAND

Type:
list
Value:
['mkisofs']                                                            

VOLNAME_COMMAND

Type:
list
Value:
['volname']                                                            

Generated by Epydoc 2.1 on Thu Mar 29 20:58:31 2007 http://epydoc.sf.net