84
84
# TODO(sandy): Find a way to import nova.notifier.api so we don't have
85
85
# to pass it in as a parameter. Otherwise we get a cyclic import of
86
86
# nova.notifier.api -> nova.utils -> nova.exception :(
87
# TODO(johannes): Also, it would be nice to use
88
# utils.save_and_reraise_exception() without an import loop
90
88
def wrapped(*args, **kw):
164
162
def __init__(self, message=None, code=None):
165
163
self.msg = message
168
outstr = '%s: %s' % (code, message)
170
outstr = '%s' % message
165
outstr = '%s' % message
171
166
super(EC2APIError, self).__init__(outstr)
178
173
super(DBError, self).__init__(str(inner_exception))
181
class DeprecatedConfig(NovaException):
182
message = _("Fatal call to deprecated config %(msg)s")
185
176
class DecryptionFailure(NovaException):
186
177
message = _("Failed to decrypt text")
213
204
message = _("Policy doesn't allow %(action)s to be performed.")
207
class ImageNotActive(NovaException):
208
message = _("Image %(image_id)s is not active.")
216
211
class ImageNotAuthorized(NovaException):
217
212
message = _("Not authorized for image %(image_id)s.")
225
class InvalidSnapshot(Invalid):
226
message = _("Invalid snapshot") + ": %(reason)s"
229
220
class VolumeUnattached(Invalid):
230
221
message = _("Volume %(volume_id)s is not attached to anything")
233
class VolumeAttached(Invalid):
234
message = _("Volume %(volume_id)s is still attached, detach volume first.")
237
224
class InvalidKeypair(Invalid):
238
225
message = _("Keypair data is invalid")
241
class SfJsonEncodeFailure(NovaException):
242
message = _("Failed to load data into json format")
245
228
class InvalidRequest(Invalid):
246
229
message = _("The request is invalid.")
250
233
message = _("Invalid input received") + ": %(reason)s"
253
class InvalidVolumeType(Invalid):
254
message = _("Invalid volume type") + ": %(reason)s"
257
236
class InvalidVolume(Invalid):
258
237
message = _("Invalid volume") + ": %(reason)s"
262
241
message = _("Invalid metadata") + ": %(reason)s"
244
class InvalidMetadataSize(Invalid):
245
message = _("Invalid metadata size") + ": %(reason)s"
265
248
class InvalidPortRange(Invalid):
266
249
message = _("Invalid port range %(from_port)s:%(to_port)s. %(msg)s")
432
class VirtDriverNotFound(NotFound):
433
message = _("Could not find driver for connection_type %(name)s")
436
class PersistentVolumeFileNotFound(NotFound):
437
message = _("Volume %(volume_id)s persistence file could not be found.")
440
415
class VolumeNotFound(NotFound):
441
416
message = _("Volume %(volume_id)s could not be found.")
444
class SfAccountNotFound(NotFound):
445
message = _("Unable to locate account %(account_name)s on "
449
class VolumeMetadataNotFound(NotFound):
450
message = _("Volume %(volume_id)s has no metadata with "
451
"key %(metadata_key)s.")
454
class VolumeTypeNotFound(NotFound):
455
message = _("Volume type %(volume_type_id)s could not be found.")
458
class VolumeTypeNotFoundByName(VolumeTypeNotFound):
459
message = _("Volume type with name %(volume_type_name)s "
460
"could not be found.")
463
class VolumeTypeExtraSpecsNotFound(NotFound):
464
message = _("Volume Type %(volume_type_id)s has no extra specs with "
465
"key %(extra_specs_key)s.")
468
419
class SnapshotNotFound(NotFound):
469
420
message = _("Snapshot %(snapshot_id)s could not be found.")
472
class VolumeIsBusy(NovaException):
473
message = _("deleting volume %(volume_name)s that has snapshot")
476
class SnapshotIsBusy(NovaException):
477
message = _("deleting snapshot %(snapshot_name)s that has "
481
423
class ISCSITargetNotFoundForVolume(NotFound):
482
424
message = _("No target id found for volume %(volume_id)s.")
485
class ISCSITargetCreateFailed(NovaException):
486
message = _("Failed to create iscsi target for volume %(volume_id)s.")
489
class ISCSITargetRemoveFailed(NovaException):
490
message = _("Failed to remove iscsi target for volume %(volume_id)s.")
493
427
class DiskNotFound(NotFound):
494
428
message = _("No disk at %(location)s")
521
455
message = _("Cannot find SR to read/write VDI.")
458
class NetworkDuplicated(NovaException):
459
message = _("Network %(network_id)s is duplicated.")
524
462
class NetworkInUse(NovaException):
525
463
message = _("Network %(network_id)s is still in use.")
558
496
"is not assigned to the project %(project_id)s.")
561
class NetworkHostNotSet(NovaException):
562
message = _("Host is not set to the network (%(network_id)s).")
565
499
class DatastoreNotFound(NotFound):
566
500
message = _("Could not find the datastore reference(s) which the VM uses.")
647
581
message = _("Floating ip not found for host %(host)s.")
584
class FloatingIpMultipleFoundForAddress(NovaException):
585
message = _("Multiple floating ips are found for address %(address)s.")
588
class FloatingIpPoolNotFound(NotFound):
589
message = _("Floating ip pool not found.")
650
593
class NoMoreFloatingIps(FloatingIpNotFound):
651
594
message = _("Zero floating ips available.")
668
611
message = _("Interface %(interface)s not found.")
614
class CannotDisassociateAutoAssignedFloatingIP(NovaException):
615
message = _("Cannot disassociate auto assigined floating ip")
671
618
class KeypairNotFound(NotFound):
672
619
message = _("Keypair %(name)s not found for user %(user_id)s")
878
825
class InstanceTypeExists(Duplicate):
879
message = _("Instance Type %(name)s already exists.")
826
message = _("Instance Type with name %(name)s already exists.")
829
class InstanceTypeIdExists(Duplicate):
830
message = _("Instance Type with ID %(flavor_id)s already exists.")
882
833
class FlavorAccessExists(Duplicate):
884
835
"and project %(project_id)s combination.")
887
class VolumeTypeExists(Duplicate):
888
message = _("Volume Type %(name)s already exists.")
891
838
class InvalidSharedStorage(NovaException):
892
839
message = _("%(path)s is not on shared storage: %(reason)s")
958
905
" but already used %(used)d of %(allowed)d %(resource)s")
961
class VolumeSizeTooLarge(QuotaError):
962
message = _("Maximum volume size exceeded")
965
class VolumeLimitExceeded(QuotaError):
966
message = _("Maximum number of volumes allowed (%(allowed)d) exceeded")
969
908
class FloatingIpLimitExceeded(QuotaError):
970
909
message = _("Maximum number of floating ips exceeded")
1020
959
message = _("Aggregate %(aggregate_id)s already has host %(host)s.")
1023
class DuplicateSfVolumeNames(Duplicate):
1024
message = _("Detected more than one volume with name %(vol_name)s")
1027
class VolumeTypeCreateFailed(NovaException):
1028
message = _("Cannot create volume_type with "
1029
"name %(name)s and specs %(extra_specs)s")
1032
class VolumeBackendAPIException(NovaException):
1033
message = _("Bad or unexpected response from the storage volume "
1034
"backend API: %(data)s")
1037
class NfsException(NovaException):
1038
message = _("Unknown NFS exception")
1041
class NfsNoSharesMounted(NotFound):
1042
message = _("No mounted NFS shares found")
1045
class NfsNoSuitableShareFound(NotFound):
1046
message = _("There is no share which can host %(volume_size)sG")
1049
962
class InstanceTypeCreateFailed(NovaException):
1050
963
message = _("Unable to create instance type")
1059
class SolidFireAPIException(NovaException):
1060
message = _("Bad response from SolidFire API")
1063
class SolidFireAPIDataException(SolidFireAPIException):
1064
message = _("Error in SolidFire API response: data=%(data)s")
1067
972
class DuplicateVlan(Duplicate):
1068
973
message = _("Detected existing vlan with id %(vlan)d")