Libraries common throughout manila or just ones that haven’t yet been categorized in depth.
manila.context
Module¶RequestContext: context for requests that persist through all of manila.
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.
elevated
(read_deleted=None, overwrite=False)Return a version of this context with admin flag set.
from_dict
(values)read_deleted
to_dict
()get_admin_context
(read_deleted='no')manila.exception
Module¶Manila base exception handling.
Includes decorator for re-raising Manila-type exceptions.
SHOULD include dedicated exception logging.
AdminIPNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Admin port IP for service instance not found: %(reason)s'AdminRequired
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotAuthorized
message
= u'User does not have admin privileges.'AvailabilityZoneNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Availability zone %(id)s could not be found.'BadConfigurationException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Bad configuration: %(reason)s.'BridgeDoesNotExist
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Bridge %(bridge)s does not exist.'ConfigNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Could not find config at %(path)s.'Conflict
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
code
= 409message
= u'%(err)s'ConvertedException
(code=400, title='', explanation='')Bases: webob.exc.WSGIHTTPException
DriverNotInitialized
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u"Share driver '%(driver)s' not initialized."EMCUnityError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'%(err)s'EMCVmaxInvalidMoverID
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Invalid mover or vdm %(id)s.'EMCVmaxLockRequiredException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Unable to acquire lock(s).'EMCVmaxXMLAPIError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'%(err)s'EMCVnxInvalidMoverID
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Invalid mover or vdm %(id)s.'EMCVnxLockRequiredException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Unable to acquire lock(s).'EMCVnxXMLAPIError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'%(err)s'Error
Bases: exceptions.Exception
EvaluatorParseException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Error during evaluator parsing: %(reason)s'ExportLocationNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Export location %(uuid)s could not be found.'FileNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'File %(file_path)s could not be found.'Found
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
code
= 302message
= u'Resource was found.'safe
= TrueGPFSException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'GPFS exception occurred.'GPFSGaneshaException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'GPFS Ganesha exception occurred.'GaneshaCommandFailure
(**kw)Bases: oslo_concurrency.processutils.ProcessExecutionError
GlusterfsException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Unknown Gluster exception.'HDFSException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'HDFS exception occurred!'HNASBackendException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'HNAS Backend Exception: %(msg)s'HNASConnException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'HNAS Connection Exception: %(msg)s'HNASItemNotFoundException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.StorageResourceNotFound
message
= u'HNAS Item Not Found Exception: %(msg)s'HNASNothingToCloneException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'HNAS Nothing To Clone Exception: %(msg)s'HNASSSCIsBusy
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'HNAS SSC is busy and cannot execute the command: %(msg)s'HPE3ParInvalid
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'%(err)s'HPE3ParInvalidClient
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'%(err)s'HPE3ParUnexpectedError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'%(err)s'HSPBackendException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'HSP Backend Exception: %(msg)s'HSPItemNotFoundException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'HSP Item Not Found Exception: %(msg)s'HSPTimeoutException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'HSP Timeout Exception: %(msg)s'HostBinaryNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Could not find binary %(binary)s on host %(host)s.'HostNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Host %(host)s could not be found.'IPAddressInUse
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InUse
message
= u'IP address %(ip)s is already used.'InUse
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Resource is in use.'InstanceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Instance %(instance_id)s could not be found.'Invalid
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
code
= 400message
= u'Unacceptable parameters.'InvalidAPIVersionString
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'API Version String %(version)s is of invalid format. Must be of format MajorNum.MinorNum.'InvalidCapacity
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid capacity: %(name)s = %(value)s.'InvalidContentType
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid content type %(content_type)s.'InvalidDriverMode
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid driver mode: %(driver_mode)s.'InvalidExtraSpec
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid extra_spec: %(reason)s.'InvalidGlobalAPIVersion
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Version %(req_ver)s is not supported by the API. Minimum is %(min_ver)s and maximum is %(max_ver)s.'InvalidHost
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid host: %(reason)s'InvalidInput
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid input received: %(reason)s.'InvalidParameterValue
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'%(err)s'InvalidQuotaValue
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Change would make usage less than 0 for the following resources: %(unders)s.'InvalidRequest
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'The request is invalid.'InvalidReservationExpiration
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid reservation expiration %(expire)s.'InvalidResults
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'The results are invalid.'InvalidShare
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share: %(reason)s.'InvalidShareAccess
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid access rule: %(reason)s'InvalidShareAccessLevel
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid or unsupported share access level: %(level)s.'InvalidShareGroup
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share group: %(reason)s'InvalidShareGroupSnapshot
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share group snapshot: %(reason)s'InvalidShareGroupType
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share group type: %(reason)s.'InvalidShareInstance
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share instance: %(reason)s.'InvalidShareMetadata
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid metadata.'InvalidShareMetadataSize
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid metadata size.'InvalidShareServer
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Share server %(share_server_id)s is not valid.'InvalidShareSnapshot
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share snapshot: %(reason)s.'InvalidShareSnapshotInstance
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share snapshot instance: %(reason)s.'InvalidShareType
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid share type: %(reason)s.'InvalidSnapshotAccess
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid access rule: %(reason)s'InvalidSqliteDB
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid Sqlite database.'InvalidUUID
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Expected a uuid but received %(uuid)s.'InvalidVolume
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Invalid volume.'LockCreationFailed
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Unable to create lock. Coordination backend not started.'LockingFailed
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Lock acquisition failed.'MalformedRequestBody
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Malformed message body: %(reason)s.'ManageExistingShareTypeMismatch
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Manage existing share failed due to share type mismatch: %(reason)s'ManageInvalidShare
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InvalidShare
message
= u'Manage existing share failed due to invalid share: %(reason)s'ManageInvalidShareSnapshot
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InvalidShareSnapshot
message
= u'Manage existing share snapshot failed due to invalid share snapshot: %(reason)s.'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.
code
= 500headers
= {}message
= u'An unknown exception occurred.'safe
= FalseMapRFSException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'MapRFS exception occurred: %(msg)s'MigrationError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Migration error: %(reason)s.'MigrationNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Migration %(migration_id)s could not be found.'MigrationNotFoundByStatus
(message=None, detail_data={}, **kwargs)Bases: manila.exception.MigrationNotFound
message
= u'Migration not found for instance %(instance_id)s with status %(status)s.'NetAppException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Exception due to NetApp failure.'NetworkBadConfigurationException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NetworkException
message
= u'Bad network configuration: %(reason)s.'NetworkBindException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Exception due to failed port status in binding.'NetworkException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Exception due to network failure.'NexentaException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'Exception due to Nexenta failure. %(reason)s'NoValidHost
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'No valid host was found. %(reason)s.'NotAuthorized
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
code
= 403message
= u'Not authorized.'NotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
code
= 404message
= u'Resource could not be found.'safe
= TrueOverQuota
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Quota exceeded for resources: %(overs)s.'PasteAppNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u"Could not load paste app '%(name)s' from %(path)s."PolicyNotAuthorized
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotAuthorized
message
= u"Policy doesn't allow %(action)s to be performed."PortLimitExceeded
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaError
message
= u'Maximum number of ports exceeded.'ProjectQuotaNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaNotFound
message
= u'Quota for project %(project_id)s could not be found.'ProjectUserQuotaNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaNotFound
message
= u'Quota for user %(user_id)s in project %(project_id)s could not be found.'QBException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Quobyte exception occurred: %(msg)s'QBRpcException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
Quobyte backend specific exception.
message
= u'Quobyte JsonRpc call to backend raised an exception: %(result)s, Quobyte error code %(qbcode)s'QuotaClassNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaNotFound
message
= u'Quota class %(class_name)s could not be found.'QuotaError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
code
= 413headers
= {'Retry-After': 0}message
= u'Quota exceeded: code=%(code)s.'safe
= TrueQuotaExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Quota exists for project %(project_id)s, resource %(resource)s.'QuotaNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Quota could not be found.'QuotaResourceUnknown
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaNotFound
message
= u'Unknown quota resources %(unknown)s.'QuotaUsageNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaNotFound
message
= u'Quota usage for project %(project_id)s could not be found.'ReplicationException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Unable to perform a replication action: %(reason)s.'ReservationNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaNotFound
message
= u'Quota reservation %(uuid)s could not be found.'SSHException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Exception in SSH protocol negotiation or logic.'SSHInjectionThreat
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'SSH command injection detected: %(command)s'SchedulerHostFilterNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Scheduler host filter %(filter_name)s could not be found.'SchedulerHostWeigherNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Scheduler host weigher %(weigher_name)s could not be found.'SecurityServiceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Security service %(security_service_id)s could not be found.'ServiceIPNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Service IP for instance not found: %(reason)s'ServiceInstanceException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Exception in service instance manager occurred.'ServiceInstanceUnavailable
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ServiceInstanceException
message
= u'Service instance is not available.'ServiceIsDown
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Service %(service)s is down.'ServiceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Service %(service_id)s could not be found.'ShareAccessExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share access %(access_type)s:%(access)s exists.'ShareBackendException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share backend error: %(msg)s.'ShareBusyException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'Share is busy with an active task: %(reason)s.'ShareCopyDataException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Failed to copy data: %(reason)s'ShareDataCopyCancelled
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Copy of contents from share instance %(src_instance)s to share instance %(dest_instance)s was cancelled.'ShareDataCopyFailed
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share Data copy failed: %(reason)s'ShareExtendingError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share %(share_id)s could not be extended due to error in the driver: %(reason)s'ShareGroupNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share group %(share_group_id)s could not be found.'ShareGroupSnapshotMemberNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share group snapshot member %(member_id)s could not be found.'ShareGroupSnapshotNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share group snapshot %(share_group_snapshot_id)s could not be found.'ShareGroupSnapshotNotSupported
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share group %(share_group)s does not support snapshots.'ShareGroupTypeAccessExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share group type access for %(type_id)s / %(project_id)s combination already exists.'ShareGroupTypeAccessNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share group type access not found for %(type_id)s / %(project_id)s combination.'ShareGroupTypeCreateFailed
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Cannot create share group type with name %(name)s and specs %(group_specs)s.'ShareGroupTypeExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share group type %(type_id)s already exists.'ShareGroupTypeInUse
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share group Type %(type_id)s deletion is not allowed with groups present with the type.'ShareGroupTypeNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share group type %(type_id)s could not be found.'ShareGroupTypeNotFoundByName
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareTypeNotFound
message
= u'Share group type with name %(type_name)s could not be found.'ShareGroupTypeSpecsNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share group type %(type_id)s has no group specs with key %(specs_key)s.'ShareLimitExceeded
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaError
message
= u'Maximum number of shares allowed (%(allowed)d) exceeded.'ShareMetadataNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Metadata item is not found.'ShareMigrationError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Error in share migration: %(reason)s'ShareMigrationFailed
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share migration failed: %(reason)s'ShareMountException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Failed to mount share: %(reason)s'ShareNetworkNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share network %(share_network_id)s could not be found.'ShareNetworkSecurityServiceAssociationError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Failed to associate share network %(share_network_id)s and security service %(security_service_id)s: %(reason)s.'ShareNetworkSecurityServiceDissociationError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Failed to dissociate share network %(share_network_id)s and security service %(security_service_id)s: %(reason)s.'ShareNetworksLimitExceeded
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaError
message
= u'Maximum number of share-networks allowed (%(allowed)d) exceeded.'ShareNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share %(share_id)s could not be found.'ShareReplicaNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share Replica %(replica_id)s could not be found.'ShareResourceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.StorageResourceNotFound
message
= u'Share id %(share_id)s could not be found in storage backend.'ShareServerInUse
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InUse
message
= u'Share server %(share_server_id)s is in use.'ShareServerNotCreated
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share server %(share_server_id)s failed on creation.'ShareServerNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share server %(share_server_id)s could not be found.'ShareServerNotFoundByFilters
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareServerNotFound
message
= u'Share server could not be found by filters: %(filters_description)s.'ShareServerNotReady
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u"Share server %(share_server_id)s failed to reach '%(state)s' within %(time)s seconds."ShareShrinkingError
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share %(share_id)s could not be shrunk due to error in the driver: %(reason)s'ShareShrinkingPossibleDataLoss
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share %(share_id)s could not be shrunk due to possible data loss'ShareSizeExceedsAvailableQuota
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaError
message
= u'Requested share exceeds allowed gigabytes quota.'ShareSnapshotAccessExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InvalidInput
message
= u'Share snapshot access %(access_type)s:%(access)s exists.'ShareSnapshotInstanceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Snapshot instance %(instance_id)s could not be found.'ShareSnapshotIsBusy
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Deleting snapshot %(snapshot_name)s that has dependent shares.'ShareSnapshotNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Snapshot %(snapshot_id)s could not be found.'ShareSnapshotNotSupported
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share %(share_name)s does not support snapshots.'ShareTypeAccessExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share type access for %(share_type_id)s / %(project_id)s combination already exists.'ShareTypeAccessNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share type access not found for %(share_type_id)s / %(project_id)s combination.'ShareTypeCreateFailed
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Cannot create share_type with name %(name)s and specs %(extra_specs)s.'ShareTypeDoesNotExist
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share Type %(share_type)s does not exist.'ShareTypeExists
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share Type %(id)s already exists.'ShareTypeExtraSpecsNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share Type %(share_type_id)s has no extra specs with key %(extra_specs_key)s.'ShareTypeInUse
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Share Type %(share_type_id)s deletion is not allowed with shares present with the type.'ShareTypeNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Share type %(share_type_id)s could not be found.'ShareTypeNotFoundByName
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareTypeNotFound
message
= u'Share type with name %(share_type_name)s could not be found.'ShareUmountException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Failed to unmount share: %(reason)s'SnapshotLimitExceeded
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaError
message
= u'Maximum number of snapshots allowed (%(allowed)d) exceeded.'SnapshotResourceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.StorageResourceNotFound
message
= u'Snapshot %(name)s not found.'SnapshotSizeExceedsAvailableQuota
(message=None, detail_data={}, **kwargs)Bases: manila.exception.QuotaError
message
= u'Requested snapshot exceeds allowed gigabytes quota.'SnapshotUnavailable
(message=None, detail_data={}, **kwargs)Bases: manila.exception.StorageResourceException
message
= u'Snapshot %(name)s info not available.'StorageCommunicationException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'Could not communicate with storage array.'StorageResourceException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'Storage resource exception.'StorageResourceNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.StorageResourceException
code
= 404message
= u'Storage resource %(name)s not found.'TegileAPIException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ShareBackendException
message
= u'Unexpected response from Tegile IntelliFlash API: %(response)s'UnmanageInvalidShare
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InvalidShare
message
= u'Unmanage existing share failed due to invalid share: %(reason)s'UnmanageInvalidShareSnapshot
(message=None, detail_data={}, **kwargs)Bases: manila.exception.InvalidShareSnapshot
message
= u'Unmanage existing share snapshot failed due to invalid share snapshot: %(reason)s.'VersionNotFoundForAPIMethod
(message=None, detail_data={}, **kwargs)Bases: manila.exception.Invalid
message
= u'API version %(version)s is not supported on this method.'VolumeNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Volume %(volume_id)s could not be found.'VolumeSnapshotNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NotFound
message
= u'Snapshot %(snapshot_id)s could not be found.'VserverNotFound
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NetAppException
message
= u'Vserver %(vserver)s not found.'VserverNotSpecified
(message=None, detail_data={}, **kwargs)Bases: manila.exception.NetAppException
message
= u'Vserver not specified.'WillNotSchedule
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u"Host %(host)s is not up or doesn't exist."ZFSonLinuxException
(message=None, detail_data={}, **kwargs)Bases: manila.exception.ManilaException
message
= u'ZFSonLinux exception occurred: %(msg)s'manila.test
Module¶Base classes for our unit tests.
Allows overriding of flags for use of fakes, and some black magic for inline callbacks.
Database
(db_session, db_migrate, sql_connection, sqlite_db, sqlite_clean_db)Bases: fixtures.fixture.Fixture
setUp
()setup_sqlite
(db_migrate)TestCase
(*args, **kwds)Bases: oslotest.base.BaseTestCase
Test case base class for all unit tests.
assertDictListMatch
(L1, L2, approx_equal=False, tolerance=0.001)Assert a list of dicts are equivalent.
assertDictMatch
(d1, d2, approx_equal=False, tolerance=0.001)Assert two dicts are equivalent.
This is a ‘deep’ match in the sense that it handles nested dictionaries appropriately.
NOTE:
If you don’t care (or don’t know) a given value, you can specify the string DONTCARE as the value. This will cause that dict-item to be skipped.
assertIn
(a, b, *args, **kwargs)Python < v2.7 compatibility. Assert ‘a’ in ‘b’.
assertIsInstance
(a, b, *args, **kwargs)Python < v2.7 compatibility.
assertIsNone
(a, *args, **kwargs)Python < v2.7 compatibility.
assertNotIn
(a, b, *args, **kwargs)Python < v2.7 compatibility. Assert ‘a’ NOT in ‘b’.
assertSubDictMatch
(sub_dict, super_dict)Assert a sub_dict is subset of super_dict.
flags
(**kw)Override flag variables for a test.
is_microversion_ge
(left, right)mock_class
(class_name, new_val=None, **kwargs)Use python mock to mock a class
Mocks the specified objects attribute with the given value. Automatically performs ‘addCleanup’ for the mock.
mock_object
(obj, attr_name, new_attr=None, **kwargs)Use python mock to mock an object attribute
Mocks the specified objects attribute with the given value. Automatically performs ‘addCleanup’ for the mock.
setUp
()Run before each test method to initialize test environment.
start_service
(name, host=None, **kwargs)tearDown
()Runs after each test method to tear down test environment.
manila.utils
Module¶Utilities and helper functions.
ComparableMixin
Bases: object
IsAMatcher
(expected_value=None)Bases: object
LazyPluggable
(pivot, **backends)Bases: object
A pluggable backend loaded lazily based on some value.
SSHPool
(ip, port, conn_timeout, login, password=None, privatekey=None, *args, **kwargs)Bases: eventlet.pools.Pool
A simple eventlet pool to hold ssh connections.
create
()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.
remove
(ssh)Close an ssh client and remove it from free_items.
check_params_are_boolean
(keys, params, default=False)Validates if keys in params are boolean.
Parameters: |
|
---|---|
Returns: | a dictionary with keys and respective retrieved value |
check_params_exist
(keys, params)Validates if keys exist in params.
Parameters: |
|
---|
check_ssh_injection
(cmd_list)cidr_to_netmask
(cidr)Convert cidr to netmask.
execute
(*cmd, **kwargs)Convenience wrapper around oslo’s execute() function.
file_open
(*args, **kwargs)Open file
see built-in file() documentation for more details
get_bool_from_api_params
(key, params, default=False, strict=True)Parse bool value from request params.
HTTPBadRequest will be directly raised either of the cases below: 1. invalid bool string was found by key(with strict on). 2. key not found while default value is invalid(with strict on).
is_eventlet_bug105
()Check if eventlet support IPv6 addresses.
See https://bitbucket.org/eventlet/eventlet/issue/105
Return type: | bool |
---|
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
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: |
|
---|
service_is_up
(service)Check whether a service is up based on last heartbeat.
tempdir
(*args, **kwds)translate_string_size_to_float
(string, multiplier='G')Translates human-readable storage size to float value.
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.
manila.wsgi
Module¶Utility methods for working with WSGI servers.
Application
Bases: object
Base WSGI application wrapper. Subclasses need to implement __call__.
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.
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.
print_generator
(app_iter)Iterator that prints the contents of a wrapper string.
Loader
(config_path=None)Bases: object
Used to load WSGI applications from paste configurations.
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 |
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.
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.
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.
process_response
(response)Do whatever you’d like to the response.
Request
(environ, charset=None, unicode_errors=None, decode_param_names=None, **kw)Bases: webob.request.Request
Router
(mapper)Bases: object
WSGI middleware that maps incoming requests to WSGI apps.
Server
(name, app, host=None, port=None, pool_size=None, protocol=<class eventlet.wsgi.HttpProtocol>, backlog=128)Bases: oslo_service.service.ServiceBase
Server class to manage a WSGI server, serving a WSGI application.
default_pool_size
= 1000host
port
reset
()Reset server greenpool size to default.
Returns: | None |
---|
start
()Start serving a WSGI application.
Returns: | None |
---|---|
Raises: | manila.exception.InvalidInput |
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 |
---|
wait
()Block, until the server has stopped.
Waits on the server’s eventlet to finish, then returns.
Returns: | None |
---|
test_exception
Module¶FakeNotifier
Bases: object
Acts like the manila.openstack.common.notifier.api module.
ERROR
= 88notify
(context, publisher, event, priority, payload)ManilaExceptionResponseCode400
(*args, **kwds)Bases: manila.test.TestCase
test_invalid
()test_invalid_content_type
()test_invalid_input
()test_invalid_parameter_value
()test_invalid_quota_value
()test_invalid_request
()test_invalid_reservation_expiration
()test_invalid_results
()test_invalid_share
()test_invalid_share_access
()test_invalid_share_metadata
()test_invalid_share_metadata_size
()test_invalid_share_snapshot
()test_invalid_share_snapshot_instance
()test_invalid_share_type
()test_invalid_uuid
()test_invalid_volume
()test_manage_invalid_share_snapshot
()test_unmanage_invalid_share_snapshot
()ManilaExceptionResponseCode403
(*args, **kwds)Bases: manila.test.TestCase
test_admin_required
()test_not_authorized
()test_policy_not_authorized
()ManilaExceptionResponseCode404
(*args, **kwds)Bases: manila.test.TestCase
test_config_not_found
()test_export_location_not_found
()test_file_not_found
()test_host_binary_not_found
()test_host_not_found
()test_instance_not_found
()test_migration_not_found
()test_migration_not_found_by_status
()test_not_found
()test_paste_app_not_found
()test_project_quota_not_found
()test_quota_class_not_found
()test_quota_not_found
()test_quota_resource_unknown
()test_quota_usage_not_found
()test_reservation_not_found
()test_scheduler_host_filter_not_found
()test_scheduler_host_weigher_not_found
()test_security_service_not_found
()test_service_not_found
()test_share_metadata_not_found
()test_share_network_not_found
()test_share_not_found
()test_share_replica_not_found_exception
()test_share_resource_not_found
()test_share_server_not_found
()test_share_server_not_found_by_filters
()test_share_snapshot_not_found
()test_share_type_does_not_exist
()test_share_type_extra_specs_not_found
()test_share_type_not_found
()test_share_type_not_found_by_name
()test_snapshot_instance_not_found
()test_snapshot_resource_not_found
()test_storage_resource_not_found
()test_volume_not_found
()test_volume_snapshot_not_found
()ManilaExceptionResponseCode413
(*args, **kwds)Bases: manila.test.TestCase
test_port_limit_exceeded
()test_quota_error
()test_share_limit_exceeded
()test_share_networks_limit_exceeded
()test_share_size_exceeds_available_quota
()test_snapshot_limit_exceeded
()ManilaExceptionTestCase
(*args, **kwds)Bases: manila.test.TestCase
test_default_error_code
()test_default_error_msg
()test_default_error_msg_with_kwargs
()test_error_code_from_kwarg
()test_error_msg
()test_error_msg_exception_with_kwargs
()test_error_msg_is_exception_to_string
()test_exception_kwargs_to_string
()test_exception_multi_kwargs_to_string
()test_exception_not_redundant_period_1_test_message_
()test_exception_not_redundant_period_2_test_message____
()test_exception_not_redundant_period_3__
()test_exception_redundant_period
()test_replication_exception
()test_snapshot_access_already_exists
()Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.