~ubuntu-branches/ubuntu/raring/nova/raring-proposed

« back to all changes in this revision

Viewing changes to nova/exception.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, Adam Gandelman, Chuck Short
  • Date: 2012-11-23 09:04:58 UTC
  • mfrom: (1.1.66)
  • Revision ID: package-import@ubuntu.com-20121123090458-91565o7aev1i1h71
Tags: 2013.1~g1-0ubuntu1
[ Adam Gandelman ]
* debian/control: Ensure novaclient is upgraded with nova,
  require python-keystoneclient >= 1:2.9.0. (LP: #1073289)
* debian/patches/{ubuntu/*, rbd-security.patch}: Dropped, applied
  upstream.
* debian/control: Add python-testtools to Build-Depends.

[ Chuck Short ]
* New upstream version.
* Refreshed debian/patches/avoid_setuptools_git_dependency.patch.
* debian/rules: FTBFS if missing binaries.
* debian/nova-scheudler.install: Add missing rabbit-queues and
  nova-rpc-zmq-receiver.
* Remove nova-volume since it doesnt exist anymore, transition to cinder-*.
* debian/rules: install apport hook in the right place.
* debian/patches/ubuntu-show-tests.patch: Display test failures.
* debian/control: Add depends on genisoimage
* debian/control: Suggest guestmount.
* debian/control: Suggest websockify. (LP: #1076442)
* debian/nova.conf: Disable nova-volume service.
* debian/control: Depend on xen-system-* rather than the hypervisor.
* debian/control, debian/mans/nova-conductor.8, debian/nova-conductor.init,
  debian/nova-conductor.install, debian/nova-conductor.logrotate
  debian/nova-conductor.manpages, debian/nova-conductor.postrm
  debian/nova-conductor.upstart.in: Add nova-conductor service.
* debian/control: Add python-fixtures as a build deps.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
89
87
    def inner(f):
90
88
        def wrapped(*args, **kw):
91
89
            try:
164
162
    def __init__(self, message=None, code=None):
165
163
        self.msg = message
166
164
        self.code = code
167
 
        if code:
168
 
            outstr = '%s: %s' % (code, message)
169
 
        else:
170
 
            outstr = '%s' % message
 
165
        outstr = '%s' % message
171
166
        super(EC2APIError, self).__init__(outstr)
172
167
 
173
168
 
178
173
        super(DBError, self).__init__(str(inner_exception))
179
174
 
180
175
 
181
 
class DeprecatedConfig(NovaException):
182
 
    message = _("Fatal call to deprecated config %(msg)s")
183
 
 
184
 
 
185
176
class DecryptionFailure(NovaException):
186
177
    message = _("Failed to decrypt text")
187
178
 
213
204
    message = _("Policy doesn't allow %(action)s to be performed.")
214
205
 
215
206
 
 
207
class ImageNotActive(NovaException):
 
208
    message = _("Image %(image_id)s is not active.")
 
209
 
 
210
 
216
211
class ImageNotAuthorized(NovaException):
217
212
    message = _("Not authorized for image %(image_id)s.")
218
213
 
222
217
    code = 400
223
218
 
224
219
 
225
 
class InvalidSnapshot(Invalid):
226
 
    message = _("Invalid snapshot") + ": %(reason)s"
227
 
 
228
 
 
229
220
class VolumeUnattached(Invalid):
230
221
    message = _("Volume %(volume_id)s is not attached to anything")
231
222
 
232
223
 
233
 
class VolumeAttached(Invalid):
234
 
    message = _("Volume %(volume_id)s is still attached, detach volume first.")
235
 
 
236
 
 
237
224
class InvalidKeypair(Invalid):
238
225
    message = _("Keypair data is invalid")
239
226
 
240
227
 
241
 
class SfJsonEncodeFailure(NovaException):
242
 
    message = _("Failed to load data into json format")
243
 
 
244
 
 
245
228
class InvalidRequest(Invalid):
246
229
    message = _("The request is invalid.")
247
230
 
250
233
    message = _("Invalid input received") + ": %(reason)s"
251
234
 
252
235
 
253
 
class InvalidVolumeType(Invalid):
254
 
    message = _("Invalid volume type") + ": %(reason)s"
255
 
 
256
 
 
257
236
class InvalidVolume(Invalid):
258
237
    message = _("Invalid volume") + ": %(reason)s"
259
238
 
262
241
    message = _("Invalid metadata") + ": %(reason)s"
263
242
 
264
243
 
 
244
class InvalidMetadataSize(Invalid):
 
245
    message = _("Invalid metadata size") + ": %(reason)s"
 
246
 
 
247
 
265
248
class InvalidPortRange(Invalid):
266
249
    message = _("Invalid port range %(from_port)s:%(to_port)s. %(msg)s")
267
250
 
429
412
    code = 404
430
413
 
431
414
 
432
 
class VirtDriverNotFound(NotFound):
433
 
    message = _("Could not find driver for connection_type %(name)s")
434
 
 
435
 
 
436
 
class PersistentVolumeFileNotFound(NotFound):
437
 
    message = _("Volume %(volume_id)s persistence file could not be found.")
438
 
 
439
 
 
440
415
class VolumeNotFound(NotFound):
441
416
    message = _("Volume %(volume_id)s could not be found.")
442
417
 
443
418
 
444
 
class SfAccountNotFound(NotFound):
445
 
    message = _("Unable to locate account %(account_name)s on "
446
 
                "Solidfire device")
447
 
 
448
 
 
449
 
class VolumeMetadataNotFound(NotFound):
450
 
    message = _("Volume %(volume_id)s has no metadata with "
451
 
                "key %(metadata_key)s.")
452
 
 
453
 
 
454
 
class VolumeTypeNotFound(NotFound):
455
 
    message = _("Volume type %(volume_type_id)s could not be found.")
456
 
 
457
 
 
458
 
class VolumeTypeNotFoundByName(VolumeTypeNotFound):
459
 
    message = _("Volume type with name %(volume_type_name)s "
460
 
                "could not be found.")
461
 
 
462
 
 
463
 
class VolumeTypeExtraSpecsNotFound(NotFound):
464
 
    message = _("Volume Type %(volume_type_id)s has no extra specs with "
465
 
                "key %(extra_specs_key)s.")
466
 
 
467
 
 
468
419
class SnapshotNotFound(NotFound):
469
420
    message = _("Snapshot %(snapshot_id)s could not be found.")
470
421
 
471
422
 
472
 
class VolumeIsBusy(NovaException):
473
 
    message = _("deleting volume %(volume_name)s that has snapshot")
474
 
 
475
 
 
476
 
class SnapshotIsBusy(NovaException):
477
 
    message = _("deleting snapshot %(snapshot_name)s that has "
478
 
                "dependent volumes")
479
 
 
480
 
 
481
423
class ISCSITargetNotFoundForVolume(NotFound):
482
424
    message = _("No target id found for volume %(volume_id)s.")
483
425
 
484
426
 
485
 
class ISCSITargetCreateFailed(NovaException):
486
 
    message = _("Failed to create iscsi target for volume %(volume_id)s.")
487
 
 
488
 
 
489
 
class ISCSITargetRemoveFailed(NovaException):
490
 
    message = _("Failed to remove iscsi target for volume %(volume_id)s.")
491
 
 
492
 
 
493
427
class DiskNotFound(NotFound):
494
428
    message = _("No disk at %(location)s")
495
429
 
521
455
    message = _("Cannot find SR to read/write VDI.")
522
456
 
523
457
 
 
458
class NetworkDuplicated(NovaException):
 
459
    message = _("Network %(network_id)s is duplicated.")
 
460
 
 
461
 
524
462
class NetworkInUse(NovaException):
525
463
    message = _("Network %(network_id)s is still in use.")
526
464
 
558
496
                "is not assigned to the project %(project_id)s.")
559
497
 
560
498
 
561
 
class NetworkHostNotSet(NovaException):
562
 
    message = _("Host is not set to the network (%(network_id)s).")
563
 
 
564
 
 
565
499
class DatastoreNotFound(NotFound):
566
500
    message = _("Could not find the datastore reference(s) which the VM uses.")
567
501
 
647
581
    message = _("Floating ip not found for host %(host)s.")
648
582
 
649
583
 
 
584
class FloatingIpMultipleFoundForAddress(NovaException):
 
585
    message = _("Multiple floating ips are found for address %(address)s.")
 
586
 
 
587
 
 
588
class FloatingIpPoolNotFound(NotFound):
 
589
    message = _("Floating ip pool not found.")
 
590
    safe = True
 
591
 
 
592
 
650
593
class NoMoreFloatingIps(FloatingIpNotFound):
651
594
    message = _("Zero floating ips available.")
652
595
    safe = True
668
611
    message = _("Interface %(interface)s not found.")
669
612
 
670
613
 
 
614
class CannotDisassociateAutoAssignedFloatingIP(NovaException):
 
615
    message = _("Cannot disassociate auto assigined floating ip")
 
616
 
 
617
 
671
618
class KeypairNotFound(NotFound):
672
619
    message = _("Keypair %(name)s not found for user %(user_id)s")
673
620
 
785
732
 
786
733
 
787
734
class ConsoleTypeInvalid(Invalid):
788
 
    message = _("Invalid console type %(console_type)s ")
 
735
    message = _("Invalid console type %(console_type)s")
789
736
 
790
737
 
791
738
class InstanceTypeNotFound(NotFound):
876
823
 
877
824
 
878
825
class InstanceTypeExists(Duplicate):
879
 
    message = _("Instance Type %(name)s already exists.")
 
826
    message = _("Instance Type with name %(name)s already exists.")
 
827
 
 
828
 
 
829
class InstanceTypeIdExists(Duplicate):
 
830
    message = _("Instance Type with ID %(flavor_id)s already exists.")
880
831
 
881
832
 
882
833
class FlavorAccessExists(Duplicate):
884
835
                "and project %(project_id)s combination.")
885
836
 
886
837
 
887
 
class VolumeTypeExists(Duplicate):
888
 
    message = _("Volume Type %(name)s already exists.")
889
 
 
890
 
 
891
838
class InvalidSharedStorage(NovaException):
892
839
    message = _("%(path)s is not on shared storage: %(reason)s")
893
840
 
958
905
                " but already used %(used)d of %(allowed)d %(resource)s")
959
906
 
960
907
 
961
 
class VolumeSizeTooLarge(QuotaError):
962
 
    message = _("Maximum volume size exceeded")
963
 
 
964
 
 
965
 
class VolumeLimitExceeded(QuotaError):
966
 
    message = _("Maximum number of volumes allowed (%(allowed)d) exceeded")
967
 
 
968
 
 
969
908
class FloatingIpLimitExceeded(QuotaError):
970
909
    message = _("Maximum number of floating ips exceeded")
971
910
 
1020
959
    message = _("Aggregate %(aggregate_id)s already has host %(host)s.")
1021
960
 
1022
961
 
1023
 
class DuplicateSfVolumeNames(Duplicate):
1024
 
    message = _("Detected more than one volume with name %(vol_name)s")
1025
 
 
1026
 
 
1027
 
class VolumeTypeCreateFailed(NovaException):
1028
 
    message = _("Cannot create volume_type with "
1029
 
                "name %(name)s and specs %(extra_specs)s")
1030
 
 
1031
 
 
1032
 
class VolumeBackendAPIException(NovaException):
1033
 
    message = _("Bad or unexpected response from the storage volume "
1034
 
                "backend API: %(data)s")
1035
 
 
1036
 
 
1037
 
class NfsException(NovaException):
1038
 
    message = _("Unknown NFS exception")
1039
 
 
1040
 
 
1041
 
class NfsNoSharesMounted(NotFound):
1042
 
    message = _("No mounted NFS shares found")
1043
 
 
1044
 
 
1045
 
class NfsNoSuitableShareFound(NotFound):
1046
 
    message = _("There is no share which can host %(volume_size)sG")
1047
 
 
1048
 
 
1049
962
class InstanceTypeCreateFailed(NovaException):
1050
963
    message = _("Unable to create instance type")
1051
964
 
1056
969
    safe = True
1057
970
 
1058
971
 
1059
 
class SolidFireAPIException(NovaException):
1060
 
    message = _("Bad response from SolidFire API")
1061
 
 
1062
 
 
1063
 
class SolidFireAPIDataException(SolidFireAPIException):
1064
 
    message = _("Error in SolidFire API response: data=%(data)s")
1065
 
 
1066
 
 
1067
972
class DuplicateVlan(Duplicate):
1068
973
    message = _("Detected existing vlan with id %(vlan)d")
1069
974