cinder.message.message_field module

Message Resource, Action, Detail and user visible message.

Use Resource, Action and Detail’s combination to indicate the Event in the format of:


Also, use exception-to-detail mapping to decrease the workload of classifying event in cinder’s task code.

class Action

Bases: object

ALL = (('001', 'schedule allocate volume'), ('002', 'attach volume'), ('003', 'copy volume to image'), ('004', 'update attachment'), ('005', 'copy image to volume'), ('006', 'unmanage volume'), ('007', 'extend volume'), ('008', 'create volume from backend storage'), ('009', 'create snapshot'), ('010', 'delete snapshot'), ('011', 'update snapshot'), ('012', 'update snapshot metadata'))
ATTACH_VOLUME = ('002', 'attach volume')
COPY_IMAGE_TO_VOLUME = ('005', 'copy image to volume')
COPY_VOLUME_TO_IMAGE = ('003', 'copy volume to image')
CREATE_VOLUME_FROM_BACKEND = ('008', 'create volume from backend storage')
EXTEND_VOLUME = ('007', 'extend volume')
SCHEDULE_ALLOCATE_VOLUME = ('001', 'schedule allocate volume')
SNAPSHOT_CREATE = ('009', 'create snapshot')
SNAPSHOT_DELETE = ('010', 'delete snapshot')
SNAPSHOT_METADATA_UPDATE = ('012', 'update snapshot metadata')
SNAPSHOT_UPDATE = ('011', 'update snapshot')
UNMANAGE_VOLUME = ('006', 'unmanage volume')
UPDATE_ATTACHMENT = ('004', 'update attachment')
class Detail

Bases: object

ALL = (('001', 'An unknown error occurred.'), ('002', 'Driver is not initialized at present.'), ('003', 'Could not find any available weighted backend.'), ('004', 'Failed to upload volume to image at backend.'), ('005', "Volume's attach mode is invalid."), ('006', 'Not enough quota resource for operation.'), ('007', 'Image used for creating volume exceeds available space.'), ('008', 'Unmanaging encrypted volumes is not supported.'), ('009', 'Compute service failed to extend volume.'), ('010', 'Volume Driver failed to extend volume.'), ('011', 'Image signature verification failed.'), ('012', 'Driver failed to create the volume.'), ('013', 'Snapshot failed to create.'), ('014', 'Volume snapshot update metadata failed.'), ('015', 'Snapshot is busy.'), ('016', 'Snapshot failed to delete.'))
DRIVER_FAILED_CREATE = ('012', 'Driver failed to create the volume.')
DRIVER_FAILED_EXTEND = ('010', 'Volume Driver failed to extend volume.')
DRIVER_NOT_INITIALIZED = ('002', 'Driver is not initialized at present.')
EXCEPTION_DETAIL_MAPPINGS = {('002', 'Driver is not initialized at present.'): ['DriverNotInitialized'], ('003', 'Could not find any available weighted backend.'): ['NoValidBackend'], ('005', "Volume's attach mode is invalid."): ['InvalidVolumeAttachMode'], ('006', 'Not enough quota resource for operation.'): ['ImageLimitExceeded', 'BackupLimitExceeded', 'SnapshotLimitExceeded'], ('007', 'Image used for creating volume exceeds available space.'): ['ImageTooBig'], ('015', 'Snapshot is busy.'): ['SnapshotIsBusy']}
FAILED_TO_UPLOAD_VOLUME = ('004', 'Failed to upload volume to image at backend.')
NOTIFY_COMPUTE_SERVICE_FAILED = ('009', 'Compute service failed to extend volume.')
NOT_ENOUGH_SPACE_FOR_IMAGE = ('007', 'Image used for creating volume exceeds available space.')
NO_BACKEND_AVAILABLE = ('003', 'Could not find any available weighted backend.')
QUOTA_EXCEED = ('006', 'Not enough quota resource for operation.')
SIGNATURE_VERIFICATION_FAILED = ('011', 'Image signature verification failed.')
SNAPSHOT_CREATE_ERROR = ('013', 'Snapshot failed to create.')
SNAPSHOT_DELETE_ERROR = ('016', 'Snapshot failed to delete.')
SNAPSHOT_IS_BUSY = ('015', 'Snapshot is busy.')
SNAPSHOT_UPDATE_METADATA_FAILED = ('014', 'Volume snapshot update metadata failed.')
UNKNOWN_ERROR = ('001', 'An unknown error occurred.')
UNMANAGE_ENC_NOT_SUPPORTED = ('008', 'Unmanaging encrypted volumes is not supported.')
VOLUME_ATTACH_MODE_INVALID = ('005', "Volume's attach mode is invalid.")
class Resource

Bases: object

translate_detail_id(exception, detail)

Get a detail_id to use for a message.

If exception is in the EXCEPTION_DETAIL_MAPPINGS, returns the detail_id of the mapped Detail field. If exception is not in the mapping or is None, returns the detail_id of the passed-in Detail field. Otherwise, returns the detail_id of Detail.UNKNOWN_ERROR.

  • exception – an Exception (or None)

  • detail – a message_field.Detail field (or None)




the detail_id of a message_field.Detail field