Common and Misc Libraries

Libraries common throughout manila or just ones that haven’t yet been categorized in depth.

The manila.context Module

RequestContext: context for requests that persist through all of manila.

class RequestContext(user_id, project_id, is_admin=None, read_deleted='no', roles=None, remote_address=None, timestamp=None, request_id=None, auth_token=None, overwrite=True, quota_class=None, service_catalog=None, **kwargs)

Bases: oslo_context.context.RequestContext

Security context and request information.

Represents the user taking a given action within the system.

RequestContext.elevated(read_deleted=None, overwrite=False)

Return a version of this context with admin flag set.

classmethod RequestContext.from_dict(values)
RequestContext.read_deleted None
RequestContext.to_dict()
get_admin_context(read_deleted='no')

The manila.exception Module

Manila base exception handling.

Includes decorator for re-raising Manila-type exceptions.

SHOULD include dedicated exception logging.

exception AdminIPNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

AdminIPNotFound.message = u'Admin port IP for service instance not found: %(reason)s'
exception AdminRequired(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotAuthorized

AdminRequired.message = u'User does not have admin privileges.'
exception AvailabilityZoneNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

AvailabilityZoneNotFound.message = u'Availability zone %(id)s could not be found.'
exception BadConfigurationException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

BadConfigurationException.message = u'Bad configuration: %(reason)s.'
exception BridgeDoesNotExist(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

BridgeDoesNotExist.message = u'Bridge %(bridge)s does not exist.'
exception CGSnapshotMemberNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

CGSnapshotMemberNotFound.message = u'CG snapshot %(member_id)s could not be found.'
exception CGSnapshotNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

CGSnapshotNotFound.message = u'Consistency group snapshot %(cgsnapshot_id)s could not be found.'
exception ConfigNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ConfigNotFound.message = u'Could not find config at %(path)s.'
exception Conflict(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

Conflict.code = 409
Conflict.message = u'%(err)s'
exception ConsistencyGroupNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ConsistencyGroupNotFound.message = u'ConsistencyGroup %(consistency_group_id)s could not be found.'
exception ConvertedException(code=400, title='', explanation='')

Bases: webob.exc.WSGIHTTPException

exception DriverNotInitialized(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

DriverNotInitialized.message = u"Share driver '%(driver)s' not initialized."
exception EMCVnxInvalidMoverID(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

EMCVnxInvalidMoverID.message = u'Invalid mover or vdm %(id)s.'
exception EMCVnxLockRequiredException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

EMCVnxLockRequiredException.message = u'Unable to acquire lock(s).'
exception EMCVnxXMLAPIError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

EMCVnxXMLAPIError.message = u'%(err)s'
exception Error

Bases: exceptions.Exception

exception ExportLocationNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ExportLocationNotFound.message = u'Export location %(uuid)s could not be found.'
exception FileNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

FileNotFound.message = u'File %(file_path)s could not be found.'
exception Found(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

Found.code = 302
Found.message = u'Resource was found.'
Found.safe = True
exception GPFSException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

GPFSException.message = u'GPFS exception occurred.'
exception GPFSGaneshaException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

GPFSGaneshaException.message = u'GPFS Ganesha exception occurred.'
exception GaneshaCommandFailure(**kw)

Bases: oslo_concurrency.processutils.ProcessExecutionError

exception GlusterfsException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

GlusterfsException.message = u'Unknown Gluster exception.'
exception HDFSException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

HDFSException.message = u'HDFS exception occurred!'
exception HNASBackendException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

HNASBackendException.message = u'HNAS Backend Exception: %(msg)s'
exception HNASConnException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

HNASConnException.message = u'HNAS Connection Exception: %(msg)s'
exception HNASItemNotFoundException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.StorageResourceNotFound

HNASItemNotFoundException.message = u'HNAS Item Not Found Exception: %(msg)s'
exception HNASNothingToCloneException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

HNASNothingToCloneException.message = u'HNAS Nothing To Clone Exception: %(msg)s'
exception HPE3ParInvalid(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

HPE3ParInvalid.message = u'%(err)s'
exception HPE3ParInvalidClient(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

HPE3ParInvalidClient.message = u'%(err)s'
exception HPE3ParUnexpectedError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

HPE3ParUnexpectedError.message = u'%(err)s'
exception HostBinaryNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

HostBinaryNotFound.message = u'Could not find binary %(binary)s on host %(host)s.'
exception HostNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

HostNotFound.message = u'Host %(host)s could not be found.'
exception InUse(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

InUse.message = u'Resource is in use.'
exception InstanceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

InstanceNotFound.message = u'Instance %(instance_id)s could not be found.'
exception Invalid(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

Invalid.code = 400
Invalid.message = u'Unacceptable parameters.'
exception InvalidAPIVersionString(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidAPIVersionString.message = u'API Version String %(version)s is of invalid format. Must be of format MajorNum.MinorNum.'
exception InvalidCGSnapshot(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidCGSnapshot.message = u'Invalid CGSnapshot: %(reason)s'
exception InvalidCapacity(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidCapacity.message = u'Invalid capacity: %(name)s = %(value)s.'
exception InvalidConsistencyGroup(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidConsistencyGroup.message = u'Invalid ConsistencyGroup: %(reason)s'
exception InvalidContentType(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidContentType.message = u'Invalid content type %(content_type)s.'
exception InvalidDriverMode(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidDriverMode.message = u'Invalid driver mode: %(driver_mode)s.'
exception InvalidExtraSpec(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidExtraSpec.message = u'Invalid extra_spec: %(reason)s.'
exception InvalidGlobalAPIVersion(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidGlobalAPIVersion.message = u'Version %(req_ver)s is not supported by the API. Minimum is %(min_ver)s and maximum is %(max_ver)s.'
exception InvalidHost(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidHost.message = u'Invalid host: %(reason)s'
exception InvalidInput(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidInput.message = u'Invalid input received: %(reason)s.'
exception InvalidParameterValue(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidParameterValue.message = u'%(err)s'
exception InvalidQuotaValue(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidQuotaValue.message = u'Change would make usage less than 0 for the following resources: %(unders)s.'
exception InvalidRequest(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidRequest.message = u'The request is invalid.'
exception InvalidReservationExpiration(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidReservationExpiration.message = u'Invalid reservation expiration %(expire)s.'
exception InvalidResults(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidResults.message = u'The results are invalid.'
exception InvalidShare(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShare.message = u'Invalid share: %(reason)s.'
exception InvalidShareAccess(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareAccess.message = u'Invalid access rule: %(reason)s'
exception InvalidShareAccessLevel(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareAccessLevel.message = u'Invalid or unsupported share access level: %(level)s.'
exception InvalidShareInstance(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareInstance.message = u'Invalid share instance: %(reason)s.'
exception InvalidShareMetadata(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareMetadata.message = u'Invalid metadata.'
exception InvalidShareMetadataSize(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareMetadataSize.message = u'Invalid metadata size.'
exception InvalidShareServer(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareServer.message = u'Share server %(share_server_id)s is not valid.'
exception InvalidShareSnapshot(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareSnapshot.message = u'Invalid share snapshot: %(reason)s.'
exception InvalidShareType(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidShareType.message = u'Invalid share type: %(reason)s.'
exception InvalidSqliteDB(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidSqliteDB.message = u'Invalid Sqlite database.'
exception InvalidUUID(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidUUID.message = u'Expected a uuid but received %(uuid)s.'
exception InvalidVolume(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

InvalidVolume.message = u'Invalid volume.'
exception MalformedRequestBody(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

MalformedRequestBody.message = u'Malformed message body: %(reason)s.'
exception ManageExistingShareTypeMismatch(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ManageExistingShareTypeMismatch.message = u'Manage existing share failed due to share type mismatch: %(reason)s'
exception ManageInvalidShare(message=None, detail_data={}, **kwargs)

Bases: manila.exception.InvalidShare

ManageInvalidShare.message = u'Manage existing share failed due to invalid share: %(reason)s'
exception ManageInvalidShareSnapshot(message=None, detail_data={}, **kwargs)

Bases: manila.exception.InvalidShareSnapshot

ManageInvalidShareSnapshot.message = u'Manage existing share snapshot failed due to invalid share snapshot: %(reason)s.'
exception ManilaException(message=None, detail_data={}, **kwargs)

Bases: exceptions.Exception

Base Manila Exception

To correctly use this class, inherit from it and define a ‘message’ property. That message will get printf’d with the keyword arguments provided to the constructor.

ManilaException.code = 500
ManilaException.headers = {}
ManilaException.message = u'An unknown exception occurred.'
ManilaException.safe = False
exception MigrationError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

MigrationError.message = u'Migration error: %(reason)s.'
exception MigrationNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

MigrationNotFound.message = u'Migration %(migration_id)s could not be found.'
exception MigrationNotFoundByStatus(message=None, detail_data={}, **kwargs)

Bases: manila.exception.MigrationNotFound

MigrationNotFoundByStatus.message = u'Migration not found for instance %(instance_id)s with status %(status)s.'
exception NetAppException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

NetAppException.message = u'Exception due to NetApp failure.'
exception NetworkBadConfigurationException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NetworkException

NetworkBadConfigurationException.message = u'Bad network configuration: %(reason)s.'
exception NetworkException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

NetworkException.message = u'Exception due to network failure.'
exception NoValidHost(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

NoValidHost.message = u'No valid host was found. %(reason)s.'
exception NotAuthorized(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

NotAuthorized.code = 403
NotAuthorized.message = u'Not authorized.'
exception NotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

NotFound.code = 404
NotFound.message = u'Resource could not be found.'
NotFound.safe = True
exception OverQuota(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

OverQuota.message = u'Quota exceeded for resources: %(overs)s.'
exception PasteAppNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

PasteAppNotFound.message = u"Could not load paste app '%(name)s' from %(path)s."
exception PolicyNotAuthorized(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotAuthorized

PolicyNotAuthorized.message = u"Policy doesn't allow %(action)s to be performed."
exception PortLimitExceeded(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaError

PortLimitExceeded.message = u'Maximum number of ports exceeded.'
exception ProjectQuotaNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaNotFound

ProjectQuotaNotFound.message = u'Quota for project %(project_id)s could not be found.'
exception ProjectUserQuotaNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaNotFound

ProjectUserQuotaNotFound.message = u'Quota for user %(user_id)s in project %(project_id)s could not be found.'
exception QBException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

QBException.message = u'Quobyte exception occurred: %(msg)s'
exception QBRpcException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

Quobyte backend specific exception.

QBRpcException.message = u'Quobyte JsonRpc call to backend raised an exception: %(result)s, Quobyte error code %(qbcode)s'
exception QuotaClassNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaNotFound

QuotaClassNotFound.message = u'Quota class %(class_name)s could not be found.'
exception QuotaError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

QuotaError.code = 413
QuotaError.headers = {'Retry-After': 0}
QuotaError.message = u'Quota exceeded: code=%(code)s.'
QuotaError.safe = True
exception QuotaExists(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

QuotaExists.message = u'Quota exists for project %(project_id)s, resource %(resource)s.'
exception QuotaNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

QuotaNotFound.message = u'Quota could not be found.'
exception QuotaResourceUnknown(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaNotFound

QuotaResourceUnknown.message = u'Unknown quota resources %(unknown)s.'
exception QuotaUsageNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaNotFound

QuotaUsageNotFound.message = u'Quota usage for project %(project_id)s could not be found.'
exception ReplicationException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ReplicationException.message = u'Unable to perform a replication action: %(reason)s.'
exception ReservationNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaNotFound

ReservationNotFound.message = u'Quota reservation %(uuid)s could not be found.'
exception SSHException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

SSHException.message = u'Exception in SSH protocol negotiation or logic.'
exception SSHInjectionThreat(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

SSHInjectionThreat.message = u'SSH command injection detected: %(command)s'
exception SchedulerHostFilterNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

SchedulerHostFilterNotFound.message = u'Scheduler host filter %(filter_name)s could not be found.'
exception SchedulerHostWeigherNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

SchedulerHostWeigherNotFound.message = u'Scheduler host weigher %(weigher_name)s could not be found.'
exception SecurityServiceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

SecurityServiceNotFound.message = u'Security service %(security_service_id)s could not be found.'
exception ServiceIPNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ServiceIPNotFound.message = u'Service IP for instance not found: %(reason)s'
exception ServiceInstanceException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ServiceInstanceException.message = u'Exception in service instance manager occurred.'
exception ServiceInstanceUnavailable(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ServiceInstanceException

ServiceInstanceUnavailable.message = u'Service instance is not available.'
exception ServiceIsDown(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

ServiceIsDown.message = u'Service %(service)s is down.'
exception ServiceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ServiceNotFound.message = u'Service %(service_id)s could not be found.'
exception ShareAccessExists(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareAccessExists.message = u'Share access %(access_type)s:%(access)s exists.'
exception ShareBackendException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareBackendException.message = u'Share backend error: %(msg)s.'
exception ShareBusyException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

ShareBusyException.message = u'Share is busy with an active task: %(reason)s.'
exception ShareCopyDataException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareCopyDataException.message = u'Failed to copy data: %(reason)s'
exception ShareDataCopyCancelled(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareDataCopyCancelled.message = u'Copy of contents from share instance %(src_instance)s to share instance %(dest_instance)s was cancelled.'
exception ShareDataCopyFailed(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareDataCopyFailed.message = u'Share Data copy failed: %(reason)s'
exception ShareExtendingError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareExtendingError.message = u'Share %(share_id)s could not be extended due to error in the driver: %(reason)s'
exception ShareLimitExceeded(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaError

ShareLimitExceeded.message = u'Maximum number of shares allowed (%(allowed)d) exceeded.'
exception ShareMetadataNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareMetadataNotFound.message = u'Metadata item is not found.'
exception ShareMigrationFailed(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareMigrationFailed.message = u'Share migration failed: %(reason)s'
exception ShareMountException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareMountException.message = u'Failed to mount share: %(reason)s'
exception ShareNetworkNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareNetworkNotFound.message = u'Share network %(share_network_id)s could not be found.'
exception ShareNetworkSecurityServiceAssociationError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareNetworkSecurityServiceAssociationError.message = u'Failed to associate share network %(share_network_id)s and security service %(security_service_id)s: %(reason)s.'
exception ShareNetworkSecurityServiceDissociationError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareNetworkSecurityServiceDissociationError.message = u'Failed to dissociate share network %(share_network_id)s and security service %(security_service_id)s: %(reason)s.'
exception ShareNetworksLimitExceeded(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaError

ShareNetworksLimitExceeded.message = u'Maximum number of share-networks allowed (%(allowed)d) exceeded.'
exception ShareNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareNotFound.message = u'Share %(share_id)s could not be found.'
exception ShareReplicaNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareReplicaNotFound.message = u'Share Replica %(replica_id)s could not be found.'
exception ShareResourceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.StorageResourceNotFound

ShareResourceNotFound.message = u'Share id %(share_id)s could not be found in storage backend.'
exception ShareServerInUse(message=None, detail_data={}, **kwargs)

Bases: manila.exception.InUse

ShareServerInUse.message = u'Share server %(share_server_id)s is in use.'
exception ShareServerNotCreated(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareServerNotCreated.message = u'Share server %(share_server_id)s failed on creation.'
exception ShareServerNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareServerNotFound.message = u'Share server %(share_server_id)s could not be found.'
exception ShareServerNotFoundByFilters(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ShareServerNotFound

ShareServerNotFoundByFilters.message = u'Share server could not be found by filters: %(filters_description)s.'
exception ShareShrinkingError(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareShrinkingError.message = u'Share %(share_id)s could not be shrunk due to error in the driver: %(reason)s'
exception ShareShrinkingPossibleDataLoss(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareShrinkingPossibleDataLoss.message = u'Share %(share_id)s could not be shrunk due to possible data loss'
exception ShareSizeExceedsAvailableQuota(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaError

ShareSizeExceedsAvailableQuota.message = u'Requested share exceeds allowed gigabytes quota.'
exception ShareSnapshotInstanceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareSnapshotInstanceNotFound.message = u'Snapshot instance %(instance_id)s could not be found.'
exception ShareSnapshotIsBusy(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareSnapshotIsBusy.message = u'Deleting snapshot %(snapshot_name)s that has dependent shares.'
exception ShareSnapshotNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareSnapshotNotFound.message = u'Snapshot %(snapshot_id)s could not be found.'
exception ShareSnapshotNotSupported(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareSnapshotNotSupported.message = u'Share %(share_name)s does not support snapshots.'
exception ShareTypeAccessExists(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareTypeAccessExists.message = u'Share type access for %(share_type_id)s / %(project_id)s combination already exists.'
exception ShareTypeAccessNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareTypeAccessNotFound.message = u'Share type access not found for %(share_type_id)s / %(project_id)s combination.'
exception ShareTypeCreateFailed(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareTypeCreateFailed.message = u'Cannot create share_type with name %(name)s and specs %(extra_specs)s.'
exception ShareTypeExists(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareTypeExists.message = u'Share Type %(id)s already exists.'
exception ShareTypeExtraSpecsNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareTypeExtraSpecsNotFound.message = u'Share Type %(share_type_id)s has no extra specs with key %(extra_specs_key)s.'
exception ShareTypeInUse(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareTypeInUse.message = u'Share Type %(share_type_id)s deletion is not allowed with shares present with the type.'
exception ShareTypeNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

ShareTypeNotFound.message = u'Share type %(share_type_id)s could not be found.'
exception ShareTypeNotFoundByName(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ShareTypeNotFound

ShareTypeNotFoundByName.message = u'Share type with name %(share_type_name)s could not be found.'
exception ShareUmountException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ShareUmountException.message = u'Failed to unmount share: %(reason)s'
exception SnapshotLimitExceeded(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaError

SnapshotLimitExceeded.message = u'Maximum number of snapshots allowed (%(allowed)d) exceeded.'
exception SnapshotResourceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.StorageResourceNotFound

SnapshotResourceNotFound.message = u'Snapshot %(name)s not found.'
exception SnapshotSizeExceedsAvailableQuota(message=None, detail_data={}, **kwargs)

Bases: manila.exception.QuotaError

SnapshotSizeExceedsAvailableQuota.message = u'Requested snapshot exceeds allowed gigabytes quota.'
exception SnapshotUnavailable(message=None, detail_data={}, **kwargs)

Bases: manila.exception.StorageResourceException

SnapshotUnavailable.message = u'Snapshot %(name)s info not available.'
exception StorageCommunicationException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ShareBackendException

StorageCommunicationException.message = u'Could not communicate with storage array.'
exception StorageResourceException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

StorageResourceException.message = u'Storage resource exception.'
exception StorageResourceNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.StorageResourceException

StorageResourceNotFound.code = 404
StorageResourceNotFound.message = u'Storage resource %(name)s not found.'
exception TegileAPIException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ShareBackendException

TegileAPIException.message = u'Unexpected response from Tegile IntelliFlash API: %(response)s'
exception UnmanageInvalidShare(message=None, detail_data={}, **kwargs)

Bases: manila.exception.InvalidShare

UnmanageInvalidShare.message = u'Unmanage existing share failed due to invalid share: %(reason)s'
exception UnmanageInvalidShareSnapshot(message=None, detail_data={}, **kwargs)

Bases: manila.exception.InvalidShareSnapshot

UnmanageInvalidShareSnapshot.message = u'Unmanage existing share snapshot failed due to invalid share snapshot: %(reason)s.'
exception VersionNotFoundForAPIMethod(message=None, detail_data={}, **kwargs)

Bases: manila.exception.Invalid

VersionNotFoundForAPIMethod.message = u'API version %(version)s is not supported on this method.'
exception VolumeNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

VolumeNotFound.message = u'Volume %(volume_id)s could not be found.'
exception VolumeSnapshotNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NotFound

VolumeSnapshotNotFound.message = u'Snapshot %(snapshot_id)s could not be found.'
exception VserverNotFound(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NetAppException

VserverNotFound.message = u'Vserver %(vserver)s not found.'
exception VserverNotSpecified(message=None, detail_data={}, **kwargs)

Bases: manila.exception.NetAppException

VserverNotSpecified.message = u'Vserver not specified.'
exception WillNotSchedule(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

WillNotSchedule.message = u"Host %(host)s is not up or doesn't exist."
exception ZFSonLinuxException(message=None, detail_data={}, **kwargs)

Bases: manila.exception.ManilaException

ZFSonLinuxException.message = u'ZFSonLinux exception occurred: %(msg)s'

The manila.test Module

The manila.utils Module

Utilities and helper functions.

class ComparableMixin

Bases: object

class IsAMatcher(expected_value=None)

Bases: object

class LazyPluggable(pivot, **backends)

Bases: object

A pluggable backend loaded lazily based on some value.

class SSHPool(ip, port, conn_timeout, login, password=None, privatekey=None, *args, **kwargs)

Bases: eventlet.pools.Pool

A simple eventlet pool to hold ssh connections.

SSHPool.create()
SSHPool.get()

Return an item from the pool, when one is available.

This may cause the calling greenthread to block. Check if a connection is active before returning it. For dead connections create and return a new connection.

SSHPool.remove(ssh)

Close an ssh client and remove it from free_items.

check_ssh_injection(cmd_list)
cidr_to_netmask(cidr)

Convert cidr to netmask.

delete_if_exists(pathname)

Delete a file, but ignore file not found error.

ensure_tree(path)

Create a directory (and any ancestor directories required)

Parameters:path – Directory to create
execute(*cmd, **kwargs)

Convenience wrapper around oslo’s execute() function.

file_open(*args, **kwargs)

Open file

see built-in file() documentation for more details

Note: The reason this is kept in a separate module is to easily
be able to provide a stub module that doesn’t alter system state at all (for unit tests)
get_from_path(items, path)

Returns a list of items matching the specified path.

Takes an XPath-like expression e.g. prop1/prop2/prop3, and for each item in items, looks up items[prop1][prop2][prop3]. Like XPath, if any of the intermediate results are lists it will treat each list item individually. A ‘None’ in items or any child expressions will be ignored, this function will not throw because of None (anywhere) in items. The returned list will contain no None values.

is_eventlet_bug105()

Check if eventlet support IPv6 addresses.

See https://bitbucket.org/eventlet/eventlet/issue/105

Return type:bool
is_ipv6_configured()

Check if system contain IPv6 capable network interface.

Return type:bool
Raises:IOError
is_valid_ip_address(ip_address, ip_version)
monkey_patch()

Patch decorator.

If the Flags.monkey_patch set as True, this function patches a decorator for all functions in specified modules. You can set decorators for each modules using CONF.monkey_patch_modules. The format is “Module path:Decorator function”. Example: ‘manila.api.ec2.cloud:’ manila.openstack.common.notifier.api.notify_decorator’

Parameters of the decorator is as follows. (See manila.openstack.common.notifier.api.notify_decorator)

name - name of the function function - object of the function

read_cached_file(filename, cache_info, reload_func=None)

Read from a file if it has been modified.

Parameters:
  • cache_info – dictionary to hold opaque cache.
  • reload_func – optional function to be called with data when file is reloaded due to a modification.
Returns:

data from file

read_file_as_root(file_path)

Secure helper to read file as root.

require_driver_initialized(func)
retry(exception, interval=1, retries=10, backoff_rate=2, wait_random=False)

A wrapper around retrying library.

This decorator allows to log and to check ‘retries’ input param. Time interval between retries is calculated in the following way: interval * backoff_rate ^ previous_attempt_number

Parameters:
  • exception – expected exception type. When wrapped function raises an exception of this type, the function execution is retried.
  • interval – param ‘interval’ is used to calculate time interval between retries: interval * backoff_rate ^ previous_attempt_number
  • retries – number of retries.
  • backoff_rate – param ‘backoff_rate’ is used to calculate time interval between retries: interval * backoff_rate ^ previous_attempt_number
  • wait_random – boolean value to enable retry with random wait timer.
service_is_up(service)

Check whether a service is up based on last heartbeat.

tempdir(*args, **kwds)
temporary_chown(*args, **kwds)

Temporarily chown a path.

Params owner_uid:
 UID of temporary owner (defaults to current user)
translate_string_size_to_float(string, multiplier='G')

Translates human-readable storage size to float value.

Supported values for ‘multiplier’ are following:
K - kilo | 1 M - mega | 1024 G - giga | 1024 * 1024 T - tera | 1024 * 1024 * 1024 P = peta | 1024 * 1024 * 1024 * 1024
returns:
  • float if correct input data provided
  • None if incorrect
trycmd(*args, **kwargs)

Convenience wrapper around oslo’s trycmd() function.

validate_service_host(context, host)
wait_for_access_update(context, db, share_instance, migration_wait_access_rules_timeout)
walk_class_hierarchy(clazz, encountered=None)

Walk class hierarchy, yielding most derived classes first.

The manila.wsgi Module

Utility methods for working with WSGI servers.

class Application

Bases: object

Base WSGI application wrapper. Subclasses need to implement __call__.

classmethod Application.factory(global_config, **local_config)

Used for paste app factories in paste.deploy config files.

Any local configuration (that is, values under the [app:APPNAME] section of the paste config) will be passed into the __init__ method as kwargs.

A hypothetical configuration would look like:

[app:wadl] latest_version = 1.3 paste.app_factory = manila.api.fancy_api:Wadl.factory

which would result in a call to the Wadl class as

import manila.api.fancy_api fancy_api.Wadl(latest_version=‘1.3’)

You could of course re-implement the factory method in subclasses, but using the kwarg passing it shouldn’t be necessary.

class Debug(application)

Bases: manila.wsgi.Middleware

Helper class for debugging a WSGI application.

Can be inserted into any WSGI application chain to get information about the request and response.

static Debug.print_generator(app_iter)

Iterator that prints the contents of a wrapper string.

class Loader(config_path=None)

Bases: object

Used to load WSGI applications from paste configurations.

Loader.load_app(name)

Return the paste URLMap wrapped WSGI application.

Parameters:name – Name of the application to load.
Returns:Paste URLMap object wrapping the requested application.
Raises:manila.exception.PasteAppNotFound
class Middleware(application)

Bases: manila.wsgi.Application

Base WSGI middleware.

These classes require an application to be initialized that will be called next. By default the middleware will simply call its wrapped app, or you can override __call__ to customize its behavior.

classmethod Middleware.factory(global_config, **local_config)

Used for paste app factories in paste.deploy config files.

Any local configuration (that is, values under the [filter:APPNAME] section of the paste config) will be passed into the __init__ method as kwargs.

A hypothetical configuration would look like:

[filter:analytics] redis_host = 127.0.0.1 paste.filter_factory = manila.api.analytics:Analytics.factory

which would result in a call to the Analytics class as

import manila.api.analytics analytics.Analytics(app_from_paste, redis_host=‘127.0.0.1’)

You could of course re-implement the factory method in subclasses, but using the kwarg passing it shouldn’t be necessary.

Middleware.process_request(req)

Called on each request.

If this returns None, the next application down the stack will be executed. If it returns a response then that response will be returned and execution will stop here.

Middleware.process_response(response)

Do whatever you’d like to the response.

class Request(environ, charset=None, unicode_errors=None, decode_param_names=None, **kw)

Bases: webob.request.Request

class Router(mapper)

Bases: object

WSGI middleware that maps incoming requests to WSGI apps.

class Server(name, app, host=None, port=None, pool_size=None, protocol=<class eventlet.wsgi.HttpProtocol at 0x7f77bb70f808>, backlog=128)

Bases: oslo_service.service.ServiceBase

Server class to manage a WSGI server, serving a WSGI application.

Server.default_pool_size = 1000
Server.host None
Server.port None
Server.reset()

Reset server greenpool size to default.

Returns:None
Server.start()

Start serving a WSGI application.

Returns:None
Raises:manila.exception.InvalidInput
Server.stop()

Stop this server.

This is not a very nice action, as currently the method by which a server is stopped is by killing its eventlet.

Returns:None
Server.wait()

Block, until the server has stopped.

Waits on the server’s eventlet to finish, then returns.

Returns:None

Tests

The test_exception Module