Coverage for manila/exception.py: 99%
578 statements
« prev ^ index » next coverage.py v7.11.0, created at 2026-02-18 22:19 +0000
« prev ^ index » next coverage.py v7.11.0, created at 2026-02-18 22:19 +0000
1# Copyright 2010 United States Government as represented by the
2# Administrator of the National Aeronautics and Space Administration.
3# All Rights Reserved.
4#
5# Licensed under the Apache License, Version 2.0 (the "License"); you may
6# not use this file except in compliance with the License. You may obtain
7# a copy of the License at
8#
9# http://www.apache.org/licenses/LICENSE-2.0
10#
11# Unless required by applicable law or agreed to in writing, software
12# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14# License for the specific language governing permissions and limitations
15# under the License.
17"""Manila base exception handling.
19Includes decorator for re-raising Manila-type exceptions.
21SHOULD include dedicated exception logging.
23"""
24import re
26from oslo_concurrency import processutils
27from oslo_config import cfg
28from oslo_log import log
29import webob.exc
31from manila.i18n import _
33LOG = log.getLogger(__name__)
35exc_log_opts = [
36 cfg.BoolOpt('fatal_exception_format_errors',
37 default=False,
38 help='Whether to make exception message format errors fatal.'),
39]
41CONF = cfg.CONF
42CONF.register_opts(exc_log_opts)
45ProcessExecutionError = processutils.ProcessExecutionError
48class ConvertedException(webob.exc.WSGIHTTPException):
49 def __init__(self, code=400, title="", explanation=""):
50 self.code = code
51 self.title = title
52 self.explanation = explanation
53 super(ConvertedException, self).__init__()
56class Error(Exception):
57 pass
60class ManilaException(Exception):
61 """Base Manila Exception
63 To correctly use this class, inherit from it and define
64 a 'message' property. That message will get printf'd
65 with the keyword arguments provided to the constructor.
67 """
68 message = _("An unknown exception occurred.")
69 code = 500
70 headers = {}
71 safe = False
73 def __init__(self, message=None, detail_data={}, **kwargs):
74 self.kwargs = kwargs
75 self.detail_data = detail_data
77 if 'code' not in self.kwargs:
78 try:
79 self.kwargs['code'] = self.code
80 except AttributeError:
81 pass
82 for k, v in self.kwargs.items():
83 if isinstance(v, Exception):
84 self.kwargs[k] = str(v)
86 if not message:
87 try:
88 message = self.message % kwargs
90 except Exception:
91 # kwargs doesn't match a variable in the message
92 # log the issue and the kwargs
93 LOG.exception('Exception in string format operation.')
94 for name, value in kwargs.items():
95 LOG.error("%(name)s: %(value)s", {
96 'name': name, 'value': value})
97 if CONF.fatal_exception_format_errors: 97 ↛ 98line 97 didn't jump to line 98 because the condition on line 97 was never true
98 raise
99 else:
100 # at least get the core message out if something happened
101 message = self.message
102 elif isinstance(message, Exception):
103 message = str(message)
105 if re.match(r'.*[^\.]\.\.$', message):
106 message = message[:-1]
107 self.msg = message
108 super(ManilaException, self).__init__(message)
111class NetworkException(ManilaException):
112 message = _("Exception due to network failure.")
115class NetworkBindException(ManilaException):
116 message = _("Exception due to failed port status in binding.")
119class NetworkBadConfigurationException(NetworkException):
120 message = _("Bad network configuration: %(reason)s.")
123class BadConfigurationException(ManilaException):
124 message = _("Bad configuration: %(reason)s.")
127class NotAuthorized(ManilaException):
128 message = _("Not authorized.")
129 code = 403
132class AdminRequired(NotAuthorized):
133 message = _("User does not have admin privileges.")
136class PolicyNotAuthorized(NotAuthorized):
137 message = _("Policy doesn't allow %(action)s to be performed.")
140class Conflict(ManilaException):
141 message = _("%(err)s")
142 code = 409
145class Invalid(ManilaException):
146 message = _("Unacceptable parameters.")
147 code = 400
150class InvalidRequest(Invalid):
151 message = _("The request is invalid.")
154class InvalidResults(Invalid):
155 message = _("The results are invalid.")
158class InvalidInput(Invalid):
159 message = _("Invalid input received: %(reason)s.")
162class InvalidContentType(Invalid):
163 message = _("Invalid content type %(content_type)s.")
166class InvalidHost(Invalid):
167 message = _("Invalid host: %(reason)s")
170# Cannot be templated as the error syntax varies.
171# msg needs to be constructed when raised.
172class InvalidParameterValue(Invalid):
173 message = _("%(err)s")
176class InvalidUUID(Invalid):
177 message = _("%(uuid)s is not a valid uuid.")
180class InvalidDriverMode(Invalid):
181 message = _("Invalid driver mode: %(driver_mode)s.")
184class InvalidAPIVersionString(Invalid):
185 message = _("API Version String %(version)s is of invalid format. Must "
186 "be of format MajorNum.MinorNum.")
189class VersionNotFoundForAPIMethod(Invalid):
190 message = _("API version %(version)s is not supported on this method.")
193class InvalidGlobalAPIVersion(Invalid):
194 message = _("Version %(req_ver)s is not supported by the API. Minimum "
195 "is %(min_ver)s and maximum is %(max_ver)s.")
198class InvalidCapacity(Invalid):
199 message = _("Invalid capacity: %(name)s = %(value)s.")
202class ValidationError(Invalid):
203 message = "%(detail)s"
206class NotFound(ManilaException):
207 message = _("Resource could not be found.")
208 code = 404
209 safe = True
212class MessageNotFound(NotFound):
213 message = _("Message %(message_id)s could not be found.")
216class ResourceLockNotFound(NotFound):
217 message = _("Resource lock %(lock_id)s could not be found.")
220class ResourceVisibilityLockExists(ManilaException):
221 message = _("Resource %(resource_id)s is already locked.")
224class Found(ManilaException):
225 message = _("Resource was found.")
226 code = 302
227 safe = True
230class InUse(ManilaException):
231 message = _("Resource is in use.")
234class AvailabilityZoneNotFound(NotFound):
235 message = _("Availability zone %(id)s could not be found.")
238class ShareNetworkNotFound(NotFound):
239 message = _("Share network %(share_network_id)s could not be found.")
242class ShareNetworkSubnetNotFound(NotFound):
243 message = _("Share network subnet %(share_network_subnet_id)s could not be"
244 " found.")
247class ShareNetworkSubnetNotFoundByShareServer(NotFound):
248 message = _("Share network subnet could not be found by "
249 "%(share_server_id)s.")
252class ShareServerNotFound(NotFound):
253 message = _("Share server %(share_server_id)s could not be found.")
256class ShareServerNotFoundByFilters(ShareServerNotFound):
257 message = _("Share server could not be found by "
258 "filters: %(filters_description)s.")
261class AllocationsNotFoundForShareServer(NotFound):
262 message = _("No allocations found for the share server "
263 "%(share_server_id)s on the subnet.")
266class InvalidShareNetwork(Invalid):
267 message = _("Invalid share network: %(reason)s")
270class ShareServerInUse(InUse):
271 message = _("Share server %(share_server_id)s is in use.")
274class ShareServerMigrationError(ManilaException):
275 message = _("Error in share server migration: %(reason)s")
278class ShareServerMigrationFailed(ManilaException):
279 message = _("Share server migration failed: %(reason)s")
282class InvalidShareServer(Invalid):
283 message = _("Invalid share server: %(reason)s")
286class ShareMigrationError(ManilaException):
287 message = _("Error in share migration: %(reason)s")
290class ShareMigrationFailed(ManilaException):
291 message = _("Share migration failed: %(reason)s")
294class ShareDataCopyFailed(ManilaException):
295 message = _("Share Data copy failed: %(reason)s")
298class ShareDataCopyCancelled(ManilaException):
299 message = _("Copy of contents from source to destination was cancelled.")
302class ServiceIPNotFound(ManilaException):
303 message = _("Service IP for instance not found: %(reason)s")
306class AdminIPNotFound(ManilaException):
307 message = _("Admin port IP for service instance not found: %(reason)s")
310class ShareServerNotCreated(ManilaException):
311 message = _("Share server %(share_server_id)s failed on creation.")
314class ShareServerNotReady(ManilaException):
315 message = _("Share server %(share_server_id)s failed to reach '%(state)s' "
316 "within %(time)s seconds.")
319class ShareServerBackendDetailsNotFound(NotFound):
320 message = _("Share server backend details does not exist.")
323class ServiceNotFound(NotFound):
324 message = _("Service %(service_id)s could not be found.")
327class ServiceIsDown(Invalid):
328 message = _("Service %(service)s is down.")
331class HostNotFound(NotFound):
332 message = _("Host %(host)s could not be found.")
335class SchedulerHostFilterNotFound(NotFound):
336 message = _("Scheduler host filter %(filter_name)s could not be found.")
339class SchedulerHostWeigherNotFound(NotFound):
340 message = _("Scheduler host weigher %(weigher_name)s could not be found.")
343class HostBinaryNotFound(NotFound):
344 message = _("Could not find binary %(binary)s on host %(host)s.")
347class TransferNotFound(NotFound):
348 message = _("Transfer %(transfer_id)s could not be found.")
351class InvalidReservationExpiration(Invalid):
352 message = _("Invalid reservation expiration %(expire)s.")
355class InvalidQuotaValue(Invalid):
356 message = _("Change would make usage less than 0 for the following "
357 "resources: %(unders)s.")
360class QuotaNotFound(NotFound):
361 message = _("Quota could not be found.")
364class QuotaExists(ManilaException):
365 message = _("Quota exists for project %(project_id)s, "
366 "resource %(resource)s.")
369class QuotaResourceUnknown(QuotaNotFound):
370 message = _("Unknown quota resources %(unknown)s.")
373class ProjectUserQuotaNotFound(QuotaNotFound):
374 message = _("Quota for user %(user_id)s in project %(project_id)s "
375 "could not be found.")
378class ProjectShareTypeQuotaNotFound(QuotaNotFound):
379 message = _("Quota for share_type %(share_type)s in "
380 "project %(project_id)s could not be found.")
383class ProjectQuotaNotFound(QuotaNotFound):
384 message = _("Quota for project %(project_id)s could not be found.")
387class QuotaClassNotFound(QuotaNotFound):
388 message = _("Quota class %(class_name)s could not be found.")
391class QuotaUsageNotFound(QuotaNotFound):
392 message = _("Quota usage for project %(project_id)s could not be found.")
395class ReservationNotFound(QuotaNotFound):
396 message = _("Quota reservation %(uuid)s could not be found.")
399class OverQuota(ManilaException):
400 message = _("Quota exceeded for resources: %(overs)s.")
403class MigrationNotFound(NotFound):
404 message = _("Migration %(migration_id)s could not be found.")
407class MigrationNotFoundByStatus(MigrationNotFound):
408 message = _("Migration not found for instance %(instance_id)s "
409 "with status %(status)s.")
412class FileNotFound(NotFound):
413 message = _("File %(file_path)s could not be found.")
416class MigrationError(ManilaException):
417 message = _("Migration error: %(reason)s.")
420class MalformedRequestBody(ManilaException):
421 message = _("Malformed message body: %(reason)s.")
424class ConfigNotFound(NotFound):
425 message = _("Could not find config at %(path)s.")
428class PasteAppNotFound(NotFound):
429 message = _("Could not load paste app '%(name)s' from %(path)s.")
432class NoValidHost(ManilaException):
433 message = _("No valid host was found. %(reason)s.")
436class WillNotSchedule(ManilaException):
437 message = _("Host %(host)s is not up or doesn't exist.")
440class QuotaError(ManilaException):
441 message = _("Quota exceeded: code=%(code)s.")
442 code = 413
443 headers = {'Retry-After': '0'}
444 safe = True
447class ShareSizeExceedsAvailableQuota(QuotaError):
448 message = _(
449 "Requested share exceeds allowed project/user or share type "
450 "gigabytes quota.")
453class SnapshotSizeExceedsAvailableQuota(QuotaError):
454 message = _(
455 "Requested snapshot exceeds allowed project/user or share type "
456 "gigabytes quota.")
459class ShareSizeExceedsLimit(QuotaError):
460 message = _(
461 "Requested share size %(size)d is larger than "
462 "maximum allowed limit %(limit)d.")
465class ShareLimitExceeded(QuotaError):
466 message = _(
467 "Maximum number of shares allowed (%(allowed)d) either per "
468 "project/user or share type quota is exceeded.")
471class SnapshotLimitExceeded(QuotaError):
472 message = _(
473 "Maximum number of snapshots allowed (%(allowed)d) either per "
474 "project/user or share type quota is exceeded.")
477class ShareNetworksLimitExceeded(QuotaError):
478 message = _("Maximum number of share-networks "
479 "allowed (%(allowed)d) exceeded.")
482class ShareGroupsLimitExceeded(QuotaError):
483 message = _(
484 "Maximum number of allowed share-groups is exceeded.")
487class ShareGroupSnapshotsLimitExceeded(QuotaError):
488 message = _(
489 "Maximum number of allowed share-group-snapshots is exceeded.")
492class ShareReplicasLimitExceeded(QuotaError):
493 message = _(
494 "Maximum number of allowed share-replicas is exceeded.")
497class ShareReplicaSizeExceedsAvailableQuota(QuotaError):
498 message = _(
499 "Requested share replica exceeds allowed project/user or share type "
500 "gigabytes quota.")
503class EncryptionKeysLimitExceeded(QuotaError):
504 message = _(
505 "Maximum number of allowed encryption keys is exceeded.")
508class GlusterfsException(ManilaException):
509 message = _("Unknown Gluster exception.")
512class InvalidShare(Invalid):
513 message = _("Invalid share: %(reason)s.")
516class InvalidAuthKey(Invalid):
517 message = _("Invalid auth key: %(reason)s")
520class ShareBusyException(Invalid):
521 message = _("Share is busy with an active task: %(reason)s.")
524class InvalidShareInstance(Invalid):
525 message = _("Invalid share instance: %(reason)s.")
528class ManageInvalidShare(InvalidShare):
529 message = _("Manage existing share failed due to "
530 "invalid share: %(reason)s")
533class ManageShareServerError(ManilaException):
534 message = _("Manage existing share server failed due to: %(reason)s")
537class UnmanageInvalidShare(InvalidShare):
538 message = _("Unmanage existing share failed due to "
539 "invalid share: %(reason)s")
542class PortLimitExceeded(QuotaError):
543 message = _("Maximum number of ports exceeded.")
546class IpAddressGenerationFailureClient(ManilaException):
547 message = _("No free IP addresses available in neutron subnet.")
550class ShareAccessExists(ManilaException):
551 message = _("Share access %(access_type)s:%(access)s exists.")
554class ShareAccessMetadataNotFound(NotFound):
555 message = _("Share access rule metadata does not exist.")
558class ShareSnapshotAccessExists(InvalidInput):
559 message = _("Share snapshot access %(access_type)s:%(access)s exists.")
562class InvalidSnapshot(Invalid):
563 message = _("Invalid snapshot: %(reason)s")
566class InvalidSnapshotAccess(Invalid):
567 message = _("Invalid access rule: %(reason)s")
570class InvalidShareAccess(Invalid):
571 message = _("Invalid access rule: %(reason)s")
574class InvalidShareAccessLevel(Invalid):
575 message = _("Invalid or unsupported share access level: %(level)s.")
578class InvalidShareAccessType(Invalid):
579 message = _("Invalid or unsupported share access type: %(type)s.")
582class DriverCannotTransferShareWithRules(ManilaException):
583 message = _("Driver failed to transfer share with rules.")
586class ShareBackendException(ManilaException):
587 message = _("Share backend error: %(msg)s.")
590class OperationNotSupportedByDriverMode(ManilaException):
591 message = _("The share driver mode does not support this operation.")
594class RequirementMissing(ManilaException):
595 message = _("Requirement %(req)s is not installed.")
598class ExportLocationNotFound(NotFound):
599 message = _("Export location %(uuid)s could not be found.")
602class ShareNotFound(NotFound):
603 message = _("Share %(share_id)s could not be found.")
606class ShareInstanceNotFound(NotFound):
607 message = _("Share instance %(share_instance_id)s could not be found.")
610class ShareSnapshotNotFound(NotFound):
611 message = _("Snapshot %(snapshot_id)s could not be found.")
614class ShareSnapshotInstanceNotFound(NotFound):
615 message = _("Snapshot instance %(instance_id)s could not be found.")
618class ShareSnapshotNotSupported(ManilaException):
619 message = _("Share %(share_name)s does not support snapshots.")
622class ShareGroupSnapshotNotSupported(ManilaException):
623 message = _("Share group %(share_group)s does not support snapshots.")
626class ShareSnapshotIsBusy(ManilaException):
627 message = _("Deleting snapshot %(snapshot_name)s that has "
628 "dependent shares.")
631class InvalidShareSnapshot(Invalid):
632 message = _("Invalid share snapshot: %(reason)s.")
635class InvalidShareSnapshotInstance(Invalid):
636 message = _("Invalid share snapshot instance: %(reason)s.")
639class ManageInvalidShareSnapshot(InvalidShareSnapshot):
640 message = _("Manage existing share snapshot failed due to "
641 "invalid share snapshot: %(reason)s.")
644class UnmanageInvalidShareSnapshot(InvalidShareSnapshot):
645 message = _("Unmanage existing share snapshot failed due to "
646 "invalid share snapshot: %(reason)s.")
649class MetadataItemNotFound(NotFound):
650 message = _("Metadata item is not found.")
653class InvalidMetadata(Invalid):
654 message = _("Invalid metadata.")
657class InvalidMetadataSize(Invalid):
658 message = _("Invalid metadata size.")
661class SecurityServiceNotFound(NotFound):
662 message = _("Security service %(security_service_id)s could not be found.")
665class InvalidSecurityService(Invalid):
666 message = _("Invalid security service: %(reason)s")
669class ShareNetworkSecurityServiceAssociationError(ManilaException):
670 message = _("Failed to associate share network %(share_network_id)s"
671 " and security service %(security_service_id)s: %(reason)s.")
674class ShareNetworkSecurityServiceDissociationError(ManilaException):
675 message = _("Failed to dissociate share network %(share_network_id)s"
676 " and security service %(security_service_id)s: %(reason)s.")
679class SecurityServiceFailedAuth(ManilaException):
680 message = _("Failed to authenticate user against security service.")
683class InvalidVolume(Invalid):
684 message = _("Invalid volume.")
687class InvalidShareType(Invalid):
688 message = _("Invalid share type: %(reason)s.")
691class InvalidShareGroupType(Invalid):
692 message = _("Invalid share group type: %(reason)s.")
695class InvalidExtraSpec(Invalid):
696 message = _("Invalid extra_spec: %(reason)s.")
699class VolumeNotFound(NotFound):
700 message = _("Volume %(volume_id)s could not be found.")
703class VolumeSnapshotNotFound(NotFound):
704 message = _("Snapshot %(snapshot_id)s could not be found.")
707class ShareTypeNotFound(NotFound):
708 message = _("Share type %(share_type_id)s could not be found.")
711class ShareGroupTypeNotFound(NotFound):
712 message = _("Share group type %(type_id)s could not be found.")
715class ShareTypeAccessNotFound(NotFound):
716 message = _("Share type access not found for %(share_type_id)s / "
717 "%(project_id)s combination.")
720class ShareGroupTypeAccessNotFound(NotFound):
721 message = _("Share group type access not found for %(type_id)s / "
722 "%(project_id)s combination.")
725class ShareTypeNotFoundByName(ShareTypeNotFound):
726 message = _("Share type with name %(share_type_name)s "
727 "could not be found.")
730class ShareGroupTypeNotFoundByName(ShareTypeNotFound):
731 message = _("Share group type with name %(type_name)s "
732 "could not be found.")
735class ShareTypeExtraSpecsNotFound(NotFound):
736 message = _("Share Type %(share_type_id)s has no extra specs with "
737 "key %(extra_specs_key)s.")
740class ShareGroupTypeSpecsNotFound(NotFound):
741 message = _("Share group type %(type_id)s has no group specs with "
742 "key %(specs_key)s.")
745class ShareTypeInUse(ManilaException):
746 message = _("Share Type %(share_type_id)s deletion is not allowed while "
747 "shares or share group types are associated with the type.")
750class IPAddressInUse(InUse):
751 message = _("IP address %(ip)s is already used.")
754class ShareGroupTypeInUse(ManilaException):
755 message = _("Share group Type %(type_id)s deletion is not allowed "
756 "with groups present with the type.")
759class ShareTypeExists(ManilaException):
760 message = _("Share Type %(id)s already exists.")
763class ShareTypeDoesNotExist(NotFound):
764 message = _("Share Type %(share_type)s does not exist.")
767class DefaultShareTypeNotConfigured(NotFound):
768 message = _("No default share type is configured. Either configure a "
769 "default share type or explicitly specify a share type.")
772class ShareGroupTypeExists(ManilaException):
773 message = _("Share group type %(type_id)s already exists.")
776class ShareTypeAccessExists(ManilaException):
777 message = _("Share type access for %(share_type_id)s / "
778 "%(project_id)s combination already exists.")
781class ShareGroupTypeAccessExists(ManilaException):
782 message = _("Share group type access for %(type_id)s / "
783 "%(project_id)s combination already exists.")
786class ShareTypeCreateFailed(ManilaException):
787 message = _("Cannot create share_type with "
788 "name %(name)s and specs %(extra_specs)s.")
791class ShareTypeUpdateFailed(ManilaException):
792 message = _("Cannot update share_type %(id)s.")
795class ManilaBarbicanACLError(ManilaException):
796 message = _("Failed while communicating to Barbican. "
797 "Please check the provided credentials .")
800class ManilaBarbicanAppCredsError(ManilaException):
801 message = _("Error occured while dealing with barbican for App Creds.")
804class ShareGroupTypeCreateFailed(ManilaException):
805 message = _("Cannot create share group type with "
806 "name %(name)s and specs %(group_specs)s.")
809class ManageExistingShareTypeMismatch(ManilaException):
810 message = _("Manage existing share failed due to share type mismatch: "
811 "%(reason)s")
814class ShareExtendingError(ManilaException):
815 message = _("Share %(share_id)s could not be extended due to error "
816 "in the driver: %(reason)s")
819class ShareShrinkingError(ManilaException):
820 message = _("Share %(share_id)s could not be shrunk due to error "
821 "in the driver: %(reason)s")
824class ShareShrinkingPossibleDataLoss(ManilaException):
825 message = _("Share %(share_id)s could not be shrunk due to "
826 "possible data loss")
829class InstanceNotFound(NotFound):
830 message = _("Instance %(instance_id)s could not be found.")
833class BridgeDoesNotExist(ManilaException):
834 message = _("Bridge %(bridge)s does not exist.")
837class ServiceInstanceException(ManilaException):
838 message = _("Exception in service instance manager occurred.")
841class ServiceInstanceUnavailable(ServiceInstanceException):
842 message = _("Service instance is not available.")
845class StorageResourceException(ManilaException):
846 message = _("Storage resource exception.")
849class StorageResourceNotFound(StorageResourceException):
850 message = _("Storage resource %(name)s not found.")
851 code = 404
854class SnapshotResourceNotFound(StorageResourceNotFound):
855 message = _("Snapshot %(name)s not found.")
858class SnapshotUnavailable(StorageResourceException):
859 message = _("Snapshot %(name)s info not available.")
862class NetAppException(ManilaException):
863 message = _("Exception due to NetApp failure.")
866class NetAppBusyAggregateForFlexGroupException(ManilaException):
867 message = _("Exception due to an aggregate being busy while trying to "
868 "provision the FlexGroup.")
871class VserverNotFound(NetAppException):
872 message = _("Vserver %(vserver)s not found.")
875class VserverNotSpecified(NetAppException):
876 message = _("Vserver not specified.")
879class VserverNotReady(NetAppException):
880 message = _("Vserver %(vserver)s is not ready yet.")
883class EMCPowerMaxXMLAPIError(Invalid):
884 message = _("%(err)s")
887class EMCPowerMaxLockRequiredException(ManilaException):
888 message = _("Unable to acquire lock(s).")
891class EMCPowerMaxInvalidMoverID(ManilaException):
892 message = _("Invalid mover or vdm %(id)s.")
895class EMCVnxXMLAPIError(Invalid):
896 message = _("%(err)s")
899class EMCVnxLockRequiredException(ManilaException):
900 message = _("Unable to acquire lock(s).")
903class EMCVnxInvalidMoverID(ManilaException):
904 message = _("Invalid mover or vdm %(id)s.")
907class EMCUnityError(ShareBackendException):
908 message = _("%(err)s")
911class HPE3ParInvalidClient(Invalid):
912 message = _("%(err)s")
915class HPE3ParInvalid(Invalid):
916 message = _("%(err)s")
919class HPE3ParUnexpectedError(ManilaException):
920 message = _("%(err)s")
923class GPFSException(ManilaException):
924 message = _("GPFS exception occurred.")
927class GPFSGaneshaException(ManilaException):
928 message = _("GPFS Ganesha exception occurred.")
931class GaneshaCommandFailure(ProcessExecutionError):
932 _description = _("Ganesha management command failed.")
934 def __init__(self, **kw):
935 if 'description' not in kw: 935 ↛ 937line 935 didn't jump to line 937 because the condition on line 935 was always true
936 kw['description'] = self._description
937 super(GaneshaCommandFailure, self).__init__(**kw)
940class InvalidSqliteDB(Invalid):
941 message = _("Invalid Sqlite database.")
944class SSHException(ManilaException):
945 message = _("Exception in SSH protocol negotiation or logic.")
948class HDFSException(ManilaException):
949 message = _("HDFS exception occurred!")
952class MapRFSException(ManilaException):
953 message = _("MapRFS exception occurred: %(msg)s")
956class ZFSonLinuxException(ManilaException):
957 message = _("ZFSonLinux exception occurred: %(msg)s")
960class QBException(ManilaException):
961 message = _("Quobyte exception occurred: %(msg)s")
964class QBRpcException(ManilaException):
965 """Quobyte backend specific exception."""
966 message = _("Quobyte JsonRpc call to backend raised "
967 "an exception: %(result)s, Quobyte error"
968 " code %(qbcode)s")
971class SSHInjectionThreat(ManilaException):
972 message = _("SSH command injection detected: %(command)s")
975class HNASBackendException(ManilaException):
976 message = _("HNAS Backend Exception: %(msg)s")
979class HNASConnException(ManilaException):
980 message = _("HNAS Connection Exception: %(msg)s")
983class HNASSSCIsBusy(ManilaException):
984 message = _("HNAS SSC is busy and cannot execute the command: %(msg)s")
987class HNASSSCContextChange(ManilaException):
988 message = _("HNAS SSC Context has been changed unexpectedly: %(msg)s")
991class HNASDirectoryNotEmpty(ManilaException):
992 message = _("HNAS Directory is not empty: %(msg)s")
995class HNASItemNotFoundException(StorageResourceNotFound):
996 message = _("HNAS Item Not Found Exception: %(msg)s")
999class HNASNothingToCloneException(ManilaException):
1000 message = _("HNAS Nothing To Clone Exception: %(msg)s")
1003# ShareGroup
1004class ShareGroupNotFound(NotFound):
1005 message = _("Share group %(share_group_id)s could not be found.")
1008class ShareGroupSnapshotNotFound(NotFound):
1009 message = _(
1010 "Share group snapshot %(share_group_snapshot_id)s could not be found.")
1013class ShareGroupSnapshotMemberNotFound(NotFound):
1014 message = _("Share group snapshot member %(member_id)s could not be "
1015 "found.")
1018class InvalidShareGroup(Invalid):
1019 message = _("Invalid share group: %(reason)s")
1022class InvalidShareGroupSnapshot(Invalid):
1023 message = _("Invalid share group snapshot: %(reason)s")
1026class DriverNotInitialized(ManilaException):
1027 message = _("Share driver '%(driver)s' not initialized.")
1030class ShareResourceNotFound(StorageResourceNotFound):
1031 message = _("Share id %(share_id)s could not be found "
1032 "in storage backend.")
1035class ShareUmountException(ManilaException):
1036 message = _("Failed to unmount share: %(reason)s")
1039class ShareMountException(ManilaException):
1040 message = _("Failed to mount share: %(reason)s")
1043class ShareCopyDataException(ManilaException):
1044 message = _("Failed to copy data: %(reason)s")
1047# Replication
1048class ReplicationException(ManilaException):
1049 message = _("Unable to perform a replication action: %(reason)s.")
1052class ShareReplicaNotFound(NotFound):
1053 message = _("Share Replica %(replica_id)s could not be found.")
1056# Tegile Storage drivers
1057class TegileAPIException(ShareBackendException):
1058 message = _("Unexpected response from Tegile IntelliFlash API: "
1059 "%(response)s")
1062class StorageCommunicationException(ShareBackendException):
1063 message = _("Could not communicate with storage array.")
1066class EvaluatorParseException(ManilaException):
1067 message = _("Error during evaluator parsing: %(reason)s")
1070# Hitachi Scaleout Platform driver
1071class HSPBackendException(ShareBackendException):
1072 message = _("HSP Backend Exception: %(msg)s")
1075class HSPTimeoutException(ShareBackendException):
1076 message = _("HSP Timeout Exception: %(msg)s")
1079class HSPItemNotFoundException(ShareBackendException):
1080 message = _("HSP Item Not Found Exception: %(msg)s")
1083class NexentaException(ShareBackendException):
1084 message = _("Exception due to Nexenta failure. %(reason)s")
1087# Tooz locking
1088class LockCreationFailed(ManilaException):
1089 message = _('Unable to create lock. Coordination backend not started.')
1092class LockingFailed(ManilaException):
1093 message = _('Lock acquisition failed.')
1096# Ganesha library
1097class GaneshaException(ManilaException):
1098 message = _("Unknown NFS-Ganesha library exception.")
1101# Infortrend Storage driver
1102class InfortrendCLIException(ShareBackendException):
1103 message = _("Infortrend CLI exception: %(err)s "
1104 "Return Code: %(rc)s, Output: %(out)s")
1107class InfortrendNASException(ShareBackendException):
1108 message = _("Infortrend NAS exception: %(err)s")
1111# Zadara storage driver
1112class ZadaraUnknownCmd(ShareBackendException):
1113 message = _("Unknown or unsupported command %(cmd)s")
1116class ZadaraSessionRequestException(ShareBackendException):
1117 message = _("%(msg)s")
1120class ZadaraBadHTTPResponseStatus(ShareBackendException):
1121 message = _("Bad HTTP response status %(status)s")
1124class ZadaraFailedCmdWithDump(ShareBackendException):
1125 message = _("Operation failed with status=%(status)s. Full dump: %(data)s")
1128class ZadaraVPSANoActiveController(ShareBackendException):
1129 message = _("Unable to find any active VPSA controller")
1132class ZadaraServerCreateFailure(ShareBackendException):
1133 message = _("Unable to create server object for initiator %(name)s")
1136class ZadaraAttachmentsNotFound(ShareBackendException):
1137 message = _("Failed to retrieve attachments for volume %(name)s")
1140class ZadaraManilaInvalidAccessKey(ShareBackendException):
1141 message = _("Invalid VPSA access key")
1144class ZadaraVPSAVolumeShareFailed(ShareBackendException):
1145 message = _("Failed to create VPSA backend share. Error: %(error)s")
1148class ZadaraInvalidShareAccessType(ShareBackendException):
1149 message = _("Only ip access type allowed for the Zadara manila share.")
1152class ZadaraShareNotFound(ShareBackendException):
1153 message = _("Share %(name)s could not be found.")
1156class ZadaraExtendShareFailed(ShareBackendException):
1157 message = _("Failed to extend VPSA backend share. Error: %(error)s")
1160class ZadaraInvalidProtocol(ShareBackendException):
1161 message = _("The type of protocol %(protocol_type)s for Zadara "
1162 "manila driver is not supported. Only NFS or CIFS "
1163 "protocol is supported.")
1166class ZadaraShareNotValid(ShareBackendException):
1167 message = _("Share %(name)s is not valid.")
1170class ZadaraVPSASnapshotCreateFailed(ShareBackendException):
1171 message = _("Failed to create VPSA share %(name)s snapshot. "
1172 "Error: %(error)s")
1175class ZadaraVPSASnapshotManageFailed(ShareBackendException):
1176 message = _("Failed to manage VPSA share snapshot with id %(snap_id)s. "
1177 "Error: %(error)s")
1180class ZadaraServerNotFound(NotFound):
1181 message = _("Unable to find server object for initiator %(name)s")
1184# Macrosan Storage driver
1185class MacrosanBackendExeption(ShareBackendException):
1186 message = _("Macrosan backend exception: %(reason)s")
1189# Backup
1190class BackupException(ManilaException):
1191 message = _("Unable to perform a backup action: %(reason)s.")
1194class InvalidBackup(Invalid):
1195 message = _("Invalid backup: %(reason)s.")
1198class BackupLimitExceeded(QuotaError):
1199 message = _("Maximum number of backups allowed (%(allowed)d) exceeded.")
1202class ShareBackupNotFound(NotFound):
1203 message = _("Backup %(backup_id)s could not be found.")
1206class ShareBackupSizeExceedsAvailableQuota(QuotaError):
1207 message = _("Requested backup exceeds allowed Backup gigabytes "
1208 "quota. Requested %(requested)sG, quota is %(quota)sG and "
1209 "%(consumed)sG has been consumed.")
1212class NetappActiveIQWeigherRequiredParameter(ManilaException):
1213 message = _("%(config)s configuration of the NetAppActiveIQ weigher "
1214 "must be set.")
1217# Vastdata Storage driver
1218class VastApiException(ManilaException):
1219 message = _("Rest api error: %(reason)s.")
1222class VastApiRetry(ManilaException):
1223 message = _("Rest api retry: %(reason)s.")
1226class VastShareNotFound(ShareBackendException):
1227 message = _("Share %(name)s could not be found.")
1230class VastDriverException(ShareBackendException):
1231 message = _("Vast driver error: %(reason)s.")