Skip to content
Newer
Older
100644 691 lines (398 sloc) 18.8 KB
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 27, 2010
1 # vim: tabstop=4 shiftwidth=4 softtabstop=4
caeece6 Updated licenses
Devin Carlen authored Jun 23, 2010
2
3 # Copyright 2010 United States Government as represented by the
4ba6802 @vishvananda Removed trailing whitespace from header
vishvananda authored Jun 23, 2010
4 # Administrator of the National Aeronautics and Space Administration.
caeece6 Updated licenses
Devin Carlen authored Jun 24, 2010
5 # All Rights Reserved.
6 #
7 # Licensed under the Apache License, Version 2.0 (the "License"); you may
8 # not use this file except in compliance with the License. You may obtain
9 # a copy of the License at
9451872 @anotherjesse Merged Vish's work on adding projects to nova
anotherjesse authored May 30, 2010
10 #
caeece6 Updated licenses
Devin Carlen authored Jun 24, 2010
11 # http://www.apache.org/licenses/LICENSE-2.0
9451872 @anotherjesse Merged Vish's work on adding projects to nova
anotherjesse authored May 30, 2010
12 #
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
13 # Unless required by applicable law or agreed to in writing, software
caeece6 Updated licenses
Devin Carlen authored Jun 24, 2010
14 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 # License for the specific language governing permissions and limitations
17 # under the License.
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
18
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
19 """Nova base exception handling.
20
21 Includes decorator for re-raising Nova-type exceptions.
22
23 SHOULD include dedicated exception logging.
24
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
25 """
26
1c5e014 @SandyWalsh phew ... working
SandyWalsh authored Jun 29, 2011
27 from functools import wraps
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
28
1c5e014 @SandyWalsh phew ... working
SandyWalsh authored Jun 30, 2011
29 from nova import log as logging
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
30
c7305af @xtoddx Apply logging changes as a giant patch to work around the cloudpipe d…
xtoddx authored Jan 4, 2011
31 LOG = logging.getLogger('nova.exception')
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
32
d508418 @termie rather comprehensive style fixes
termie authored Aug 16, 2010
33
fc5e1c6 @vishvananda a few formatting fixes and moved exception
vishvananda authored Sep 7, 2010
34 class ProcessExecutionError(IOError):
35 def __init__(self, stdout=None, stderr=None, exit_code=None, cmd=None,
36 description=None):
37 if description is None:
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
38 description = _('Unexpected error while running command.')
fc5e1c6 @vishvananda a few formatting fixes and moved exception
vishvananda authored Sep 8, 2010
39 if exit_code is None:
40 exit_code = '-'
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
41 message = _('%(description)s\nCommand: %(cmd)s\n'
42 'Exit code: %(exit_code)s\nStdout: %(stdout)r\n'
43 'Stderr: %(stderr)r') % locals()
fc5e1c6 @vishvananda a few formatting fixes and moved exception
vishvananda authored Sep 8, 2010
44 IOError.__init__(self, message)
45
46
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
47 class Error(Exception):
9451872 @anotherjesse Merged Vish's work on adding projects to nova
anotherjesse authored May 30, 2010
48 def __init__(self, message=None):
49 super(Error, self).__init__(message)
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
50
d508418 @termie rather comprehensive style fixes
termie authored Aug 16, 2010
51
9451872 @anotherjesse Merged Vish's work on adding projects to nova
anotherjesse authored May 30, 2010
52 class ApiError(Error):
430975c ApiError code should default to None, and will only display a code if…
John Tran authored Apr 6, 2011
53 def __init__(self, message='Unknown', code=None):
8d9e8ea merging trunk; resolving conflicts; fixing issue with ApiError test f…
Brian Waldon authored May 2, 2011
54 self.msg = message
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
55 self.code = code
430975c ApiError code should default to None, and will only display a code if…
John Tran authored Apr 7, 2011
56 if code:
57 outstr = '%s: %s' % (code, message)
58 else:
59 outstr = '%s' % message
60 super(ApiError, self).__init__(outstr)
e66f301 @EdLeafe Got the basic 'set admin password' stuff working
EdLeafe authored Jan 6, 2011
61
62
1ecd9b3 adding 'building' power state; testing for 409 from OSAPI when rebuil…
Brian Waldon authored Mar 31, 2011
63 class BuildInProgress(Error):
64 pass
bf6e6e7 @anotherjesse initial commit
anotherjesse authored May 28, 2010
65
d508418 @termie rather comprehensive style fixes
termie authored Aug 16, 2010
66
9bdcc71 @vishvananda wrap sqlalchemy exceptions in a generic error
vishvananda authored Jan 21, 2011
67 class DBError(Error):
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
68 """Wraps an implementation specific exception."""
ae18421 @vishvananda Tests to assure all exceptions can be raised as well as fixing NotAut…
vishvananda authored Jun 2, 2011
69 def __init__(self, inner_exception=None):
9bdcc71 @vishvananda wrap sqlalchemy exceptions in a generic error
vishvananda authored Jan 21, 2011
70 self.inner_exception = inner_exception
71 super(DBError, self).__init__(str(inner_exception))
72
73
74 def wrap_db_error(f):
75 def _wrap(*args, **kwargs):
76 try:
77 return f(*args, **kwargs)
78 except Exception, e:
f69600e @termie docstring cleanup, nova dir
termie authored Apr 20, 2011
79 LOG.exception(_('DB exception wrapped.'))
9bdcc71 @vishvananda wrap sqlalchemy exceptions in a generic error
vishvananda authored Jan 21, 2011
80 raise DBError(e)
81 return _wrap
82 _wrap.func_name = f.func_name
83
84
799919f @SandyWalsh done and done
SandyWalsh authored Jun 29, 2011
85 def wrap_exception(notifier=None, publisher_id=None, event_type=None,
86 level=None):
1c5e014 @SandyWalsh phew ... working
SandyWalsh authored Jun 30, 2011
87 """This decorator wraps a method to catch any exceptions that may
88 get thrown. It logs the exception as well as optionally sending
89 it to the notification system.
90 """
91 # TODO(sandy): Find a way to import nova.notifier.api so we don't have
92 # to pass it in as a parameter. Otherwise we get a cyclic import of
93 # nova.notifier.api -> nova.utils -> nova.exception :(
94 def inner(f):
95 def wrapped(*args, **kw):
96 try:
97 return f(*args, **kw)
98 except Exception, e:
99 if notifier:
100 payload = dict(args=args, exception=e)
101 payload.update(kw)
102
103 # Use a temp vars so we don't shadow
104 # our outer definitions.
105 temp_level = level
106 if not temp_level:
107 temp_level = notifier.ERROR
108
109 temp_type = event_type
110 if not temp_type:
111 # If f has multiple decorators, they must use
112 # functools.wraps to ensure the name is
113 # propagated.
114 temp_type = f.__name__
115
e789dd2 @SandyWalsh review fixes
SandyWalsh authored Jul 1, 2011
116 notifier.notify(publisher_id, temp_type, temp_level,
117 payload)
1c5e014 @SandyWalsh phew ... working
SandyWalsh authored Jun 30, 2011
118
119 if not isinstance(e, Error):
120 #exc_type, exc_value, exc_traceback = sys.exc_info()
121 LOG.exception(_('Uncaught exception'))
122 #logging.error(traceback.extract_stack(exc_traceback))
123 raise Error(str(e))
124 raise
125
126 return wraps(f)(wrapped)
127 return inner
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
128
129
130 class NovaException(Exception):
8762168 adding documentation & error handling
Brian Waldon authored Apr 15, 2011
131 """Base Nova Exception
132
133 To correctly use this class, inherit from it and define
134 a 'message' property. That message will get printf'd
135 with the keyword arguments provided to the constructor.
136
137 """
f5ef0e4 one last i18n string
Brian Waldon authored Apr 19, 2011
138 message = _("An unknown exception occurred.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
139
140 def __init__(self, **kwargs):
8762168 adding documentation & error handling
Brian Waldon authored Apr 15, 2011
141 try:
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
142 self._error_string = self.message % kwargs
8762168 adding documentation & error handling
Brian Waldon authored Apr 15, 2011
143
144 except Exception:
145 # at least get the core message out if something happened
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
146 self._error_string = self.message
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
147
148 def __str__(self):
149 return self._error_string
150
151
0502a2b @tr3buchet updated the exceptions around virtual interface creation, updated fla…
tr3buchet authored Jun 20, 2011
152 class VirtualInterfaceCreateException(NovaException):
153 message = _("Virtual Interface creation failed")
154
155
a2f9e4b @tr3buchet renamed VirtualInterface exception and extend NovaException
tr3buchet authored Jun 17, 2011
156 class VirtualInterfaceMacAddressException(NovaException):
157 message = _("5 attempts to create virtual interface"
158 "with unique mac address failed")
0438855 @tr3buchet removed network_info shims in vmops
tr3buchet authored Jun 8, 2011
159
160
8e6875e further cleanup of nova/exceptions.py
Brian Waldon authored Apr 27, 2011
161 class NotAuthorized(NovaException):
162 message = _("Not authorized.")
163
164 def __init__(self, *args, **kwargs):
ae18421 @vishvananda Tests to assure all exceptions can be raised as well as fixing NotAut…
vishvananda authored Jun 2, 2011
165 super(NotAuthorized, self).__init__(**kwargs)
8e6875e further cleanup of nova/exceptions.py
Brian Waldon authored Apr 27, 2011
166
167
168 class AdminRequired(NotAuthorized):
169 message = _("User does not have admin privileges")
170
171
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
172 class Invalid(NovaException):
8e6875e further cleanup of nova/exceptions.py
Brian Waldon authored Apr 27, 2011
173 message = _("Unacceptable parameters.")
174
175
176 class InvalidSignature(Invalid):
177 message = _("Invalid signature %(signature)s for user %(user)s.")
178
179
180 class InvalidInput(Invalid):
181 message = _("Invalid input received") + ": %(reason)s"
182
183
184 class InvalidInstanceType(Invalid):
185 message = _("Invalid instance type %(instance_type)s.")
186
187
188 class InvalidPortRange(Invalid):
189 message = _("Invalid port range %(from_port)s:%(to_port)s.")
190
191
192 class InvalidIpProtocol(Invalid):
193 message = _("Invalid IP protocol %(protocol)s.")
194
195
196 class InvalidContentType(Invalid):
197 message = _("Invalid content type %(content_type)s.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
198
9d0b441 @Daviey pep8'd
Daviey authored Jul 18, 2011
199
200 # Cannot be templated as the error syntax varies.
201 # msg needs to be constructed when raised.
5c6e4aa @Daviey Some basic validation for creating ec2 security groups. (LP: #715443)
Daviey authored Jul 17, 2011
202 class InvalidParameterValue(Invalid):
203 message = _("%(err)s")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
204
9d0b441 @Daviey pep8'd
Daviey authored Jul 17, 2011
205
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
206 class InstanceNotRunning(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
207 message = _("Instance %(instance_id)s is not running.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
208
209
210 class InstanceNotSuspended(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
211 message = _("Instance %(instance_id)s is not suspended.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
212
213
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
214 class InstanceNotInRescueMode(Invalid):
215 message = _("Instance %(instance_id)s is not in rescue mode")
216
217
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
218 class InstanceSuspendFailure(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
219 message = _("Failed to suspend instance") + ": %(reason)s"
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
220
221
222 class InstanceResumeFailure(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
223 message = _("Failed to resume server") + ": %(reason)s."
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
224
225
226 class InstanceRebootFailure(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
227 message = _("Failed to reboot instance") + ": %(reason)s"
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
228
229
230 class ServiceUnavailable(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
231 message = _("Service is unavailable at this time.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
232
233
234 class VolumeServiceUnavailable(ServiceUnavailable):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
235 message = _("Volume service is unavailable at this time.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
236
237
238 class ComputeServiceUnavailable(ServiceUnavailable):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
239 message = _("Compute service is unavailable at this time.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
240
241
242 class UnableToMigrateToSelf(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
243 message = _("Unable to migrate instance (%(instance_id)s) "
7b5cf70 multi-line string spacing
Brian Waldon authored Apr 19, 2011
244 "to current host (%(host)s).")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
245
246
247 class SourceHostUnavailable(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
248 message = _("Original compute host is unavailable at this time.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
249
250
251 class InvalidHypervisorType(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
252 message = _("The supplied hypervisor type of is invalid.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
253
254
255 class DestinationHypervisorTooOld(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
256 message = _("The instance requires a newer hypervisor version than "
7b5cf70 multi-line string spacing
Brian Waldon authored Apr 19, 2011
257 "has been provided.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
258
259
260 class InvalidDevicePath(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
261 message = _("The supplied device path (%(path)s) is invalid.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
262
263
264 class InvalidCPUInfo(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
265 message = _("Unacceptable CPU info") + ": %(reason)s"
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
266
267
268 class InvalidVLANTag(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
269 message = _("VLAN tag is not appropriate for the port group "
7b5cf70 multi-line string spacing
Brian Waldon authored Apr 19, 2011
270 "%(bridge)s. Expected VLAN tag is %(tag)s, "
271 "but the one associated with the port group is %(pgroup)s.")
4b07856 initial roundup of all 'exception.Invalid' cases
Brian Waldon authored Apr 14, 2011
272
273
274 class InvalidVLANPortGroup(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
275 message = _("vSwitch which contains the port group %(bridge)s is "
7b5cf70 multi-line string spacing
Brian Waldon authored Apr 19, 2011
276 "not associated with the desired physical adapter. "
277 "Expected vSwitch is %(expected)s, but the one associated "
278 "is %(actual)s.")
ad138a5 correcting tests; pep8
Brian Waldon authored Apr 15, 2011
279
280
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
281 class InvalidDiskFormat(Invalid):
282 message = _("Disk format %(disk_format)s is not acceptable")
283
284
ad138a5 correcting tests; pep8
Brian Waldon authored Apr 15, 2011
285 class ImageUnacceptable(Invalid):
9c6cbd4 moving dynamic i18n to static
Brian Waldon authored Apr 19, 2011
286 message = _("Image %(image_id)s is unacceptable") + ": %(reason)s"
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
287
288
289 class InstanceUnacceptable(Invalid):
290 message = _("Instance %(instance_id)s is unacceptable") + ": %(reason)s"
291
292
3b0b69d @vishvananda make sure proper exceptions are raised for ec2 id conversion and add …
vishvananda authored May 11, 2011
293 class InvalidEc2Id(Invalid):
294 message = _("Ec2 id %(ec2_id)s is unacceptable.")
295
296
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
297 class NotFound(NovaException):
298 message = _("Resource could not be found.")
299
300 def __init__(self, *args, **kwargs):
301 super(NotFound, self).__init__(**kwargs)
302
303
01f7b0a @rconradharris Adding FlagNotSet exception
rconradharris authored May 18, 2011
304 class FlagNotSet(NotFound):
305 message = _("Required flag %(flag)s not set.")
306
307
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
308 class InstanceNotFound(NotFound):
309 message = _("Instance %(instance_id)s could not be found.")
310
311
312 class VolumeNotFound(NotFound):
313 message = _("Volume %(volume_id)s could not be found.")
314
315
316 class VolumeNotFoundForInstance(VolumeNotFound):
317 message = _("Volume not found for instance %(instance_id)s.")
318
319
2ecfa05 @kazum Merge trunk
kazum authored May 13, 2011
320 class SnapshotNotFound(NotFound):
321 message = _("Snapshot %(snapshot_id)s could not be found.")
322
323
4f7cfba @yamahata volume/driver: implement basic snapshot
yamahata authored May 13, 2011
324 class VolumeIsBusy(Error):
325 message = _("deleting volume %(volume_name)s that has snapshot")
326
327
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
328 class ExportDeviceNotFoundForVolume(NotFound):
329 message = _("No export device found for volume %(volume_id)s.")
330
331
332 class ISCSITargetNotFoundForVolume(NotFound):
333 message = _("No target id found for volume %(volume_id)s.")
334
335
336 class DiskNotFound(NotFound):
337 message = _("No disk at %(location)s")
338
339
e16b2d2 @ironcamel Fixed some tests.
ironcamel authored May 20, 2011
340 class InvalidImageRef(Invalid):
099c295 @ironcamel Handle the case when a v1.0 api tries to list servers that contain im…
ironcamel authored May 31, 2011
341 message = _("Invalid image href %(image_href)s.")
342
343
344 class ListingImageRefsNotSupported(Invalid):
345 message = _("Some images have been stored via hrefs."
346 + " This version of the api does not support displaying image hrefs.")
e16b2d2 @ironcamel Fixed some tests.
ironcamel authored May 20, 2011
347
348
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
349 class ImageNotFound(NotFound):
350 message = _("Image %(image_id)s could not be found.")
351
352
353 class KernelNotFoundForImage(ImageNotFound):
354 message = _("Kernel not found for image %(image_id)s.")
355
356
357 class RamdiskNotFoundForImage(ImageNotFound):
358 message = _("Ramdisk not found for image %(image_id)s.")
359
360
361 class UserNotFound(NotFound):
362 message = _("User %(user_id)s could not be found.")
363
364
365 class ProjectNotFound(NotFound):
366 message = _("Project %(project_id)s could not be found.")
367
368
369 class ProjectMembershipNotFound(NotFound):
370 message = _("User %(user_id)s is not a member of project %(project_id)s.")
371
372
373 class UserRoleNotFound(NotFound):
374 message = _("Role %(role_id)s could not be found.")
375
376
377 class StorageRepositoryNotFound(NotFound):
378 message = _("Cannot find SR to read/write VDI.")
379
380
381 class NetworkNotFound(NotFound):
382 message = _("Network %(network_id)s could not be found.")
383
384
385 class NetworkNotFoundForBridge(NetworkNotFound):
386 message = _("Network could not be found for bridge %(bridge)s")
387
388
389 class NetworkNotFoundForCidr(NetworkNotFound):
390 message = _("Network could not be found with cidr %(cidr)s.")
391
392
393 class NetworkNotFoundForInstance(NetworkNotFound):
394 message = _("Network could not be found for instance %(instance_id)s.")
395
396
397 class NoNetworksFound(NotFound):
398 message = _("No networks defined.")
399
400
401 class DatastoreNotFound(NotFound):
402 message = _("Could not find the datastore reference(s) which the VM uses.")
403
404
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
405 class FixedIpNotFound(NotFound):
406 message = _("No fixed IP associated with id %(id)s.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
407
408
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
409 class FixedIpNotFoundForAddress(FixedIpNotFound):
410 message = _("Fixed ip not found for address %(address)s.")
411
412
413 class FixedIpNotFoundForInstance(FixedIpNotFound):
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
414 message = _("Instance %(instance_id)s has zero fixed ips.")
415
416
e6ebcbd @SandyWalsh pre trunk merge
SandyWalsh authored Jul 11, 2011
417 class FixedIpNotFoundForSpecificInstance(FixedIpNotFound):
418 message = _("Instance %(instance_id)s doesn't have fixed ip '%(ip)s'.")
419
420
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
421 class FixedIpNotFoundForVirtualInterface(FixedIpNotFound):
89ad3e4 @tr3buchet updated fixed ip and floating ip exceptions
tr3buchet authored Jun 17, 2011
422 message = _("Virtual interface %(vif_id)s has zero associated fixed ips.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
423
5e4d90b added disassociate method to tests
Eldar Nugaev authored Jun 25, 2011
424
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
425 class FixedIpNotFoundForHost(FixedIpNotFound):
426 message = _("Host %(host)s has zero fixed ips.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
427
428
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
429 class NoMoreFixedIps(Error):
430 message = _("Zero fixed ips available.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
431
432
d3c6f77 @tr3buchet moved auto assign floating ip functionality from compute manager to n…
tr3buchet authored May 24, 2011
433 class NoFixedIpsDefined(NotFound):
434 message = _("Zero fixed ips could be found.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
435
436
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
437 class FloatingIpNotFound(NotFound):
438 message = _("Floating ip not found for id %(id)s.")
d3c6f77 @tr3buchet moved auto assign floating ip functionality from compute manager to n…
tr3buchet authored May 24, 2011
439
440
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
441 class FloatingIpNotFoundForAddress(FloatingIpNotFound):
d3c6f77 @tr3buchet moved auto assign floating ip functionality from compute manager to n…
tr3buchet authored May 24, 2011
442 message = _("Floating ip not found for address %(address)s.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
443
444
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
445 class FloatingIpNotFoundForProject(FloatingIpNotFound):
89ad3e4 @tr3buchet updated fixed ip and floating ip exceptions
tr3buchet authored Jun 17, 2011
446 message = _("Floating ip not found for project %(project_id)s.")
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
447
448
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
449 class FloatingIpNotFoundForHost(FloatingIpNotFound):
450 message = _("Floating ip not found for host %(host)s.")
451
452
89ad3e4 @tr3buchet updated fixed ip and floating ip exceptions
tr3buchet authored Jun 17, 2011
453 class NoMoreFloatingIps(FloatingIpNotFound):
05fecdf added new exception more descriptive of not having available floating…
John Tran authored Jun 10, 2011
454 message = _("Zero floating ips available.")
455
456
89ad3e4 @tr3buchet updated fixed ip and floating ip exceptions
tr3buchet authored Jun 17, 2011
457 class NoFloatingIpsDefined(NotFound):
772a2ce @tr3buchet merged trunk, fixed the floating_ip fixed_ip exception stupidity
tr3buchet authored Jun 29, 2011
458 message = _("Zero floating ips exist.")
05fecdf added new exception more descriptive of not having available floating…
John Tran authored Jun 10, 2011
459
460
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
461 class KeypairNotFound(NotFound):
462 message = _("Keypair %(keypair_name)s not found for user %(user_id)s")
463
464
465 class CertificateNotFound(NotFound):
466 message = _("Certificate %(certificate_id)s not found.")
467
468
469 class ServiceNotFound(NotFound):
470 message = _("Service %(service_id)s could not be found.")
471
472
473 class HostNotFound(NotFound):
474 message = _("Host %(host)s could not be found.")
475
476
477 class ComputeHostNotFound(HostNotFound):
478 message = _("Compute host %(host)s could not be found.")
479
480
481 class HostBinaryNotFound(NotFound):
482 message = _("Could not find binary %(binary)s on host %(host)s.")
483
484
485 class AuthTokenNotFound(NotFound):
486 message = _("Auth token %(token)s could not be found.")
487
488
489 class AccessKeyNotFound(NotFound):
490 message = _("Access Key %(access_key)s could not be found.")
491
492
493 class QuotaNotFound(NotFound):
494 message = _("Quota could not be found")
495
496
497 class ProjectQuotaNotFound(QuotaNotFound):
498 message = _("Quota for project %(project_id)s could not be found.")
499
500
501 class SecurityGroupNotFound(NotFound):
502 message = _("Security group %(security_group_id)s not found.")
503
504
505 class SecurityGroupNotFoundForProject(SecurityGroupNotFound):
506 message = _("Security group %(security_group_id)s not found "
507 "for project %(project_id)s.")
508
509
510 class SecurityGroupNotFoundForRule(SecurityGroupNotFound):
511 message = _("Security group with rule %(rule_id)s not found.")
512
513
514 class MigrationNotFound(NotFound):
515 message = _("Migration %(migration_id)s could not be found.")
516
517
518 class MigrationNotFoundByStatus(MigrationNotFound):
519 message = _("Migration not found for instance %(instance_id)s "
520 "with status %(status)s.")
521
522
523 class ConsolePoolNotFound(NotFound):
524 message = _("Console pool %(pool_id)s could not be found.")
525
526
527 class ConsolePoolNotFoundForHostType(NotFound):
528 message = _("Console pool of type %(console_type)s "
529 "for compute host %(compute_host)s "
530 "on proxy host %(host)s not found.")
531
532
533 class ConsoleNotFound(NotFound):
534 message = _("Console %(console_id)s could not be found.")
535
536
537 class ConsoleNotFoundForInstance(ConsoleNotFound):
538 message = _("Console for instance %(instance_id)s could not be found.")
539
540
541 class ConsoleNotFoundInPoolForInstance(ConsoleNotFound):
542 message = _("Console for instance %(instance_id)s "
543 "in pool %(pool_id)s could not be found.")
544
545
546 class NoInstanceTypesFound(NotFound):
547 message = _("Zero instance types found.")
548
549
550 class InstanceTypeNotFound(NotFound):
551 message = _("Instance type %(instance_type_id)s could not be found.")
552
553
554 class InstanceTypeNotFoundByName(InstanceTypeNotFound):
555 message = _("Instance type with name %(instance_type_name)s "
556 "could not be found.")
557
558
559 class FlavorNotFound(NotFound):
560 message = _("Flavor %(flavor_id)s could not be found.")
561
562
563 class ZoneNotFound(NotFound):
564 message = _("Zone %(zone_id)s could not be found.")
565
566
714fe83 @SandyWalsh get rid of all mention of drivers ... it's filter only now
SandyWalsh authored May 23, 2011
567 class SchedulerHostFilterNotFound(NotFound):
568 message = _("Scheduler Host Filter %(filter_name)s could not be found.")
f50c726 @SandyWalsh tests and better driver loading
SandyWalsh authored May 3, 2011
569
570
579bbde @rconradharris Merging in Sandy's changes adding Noop Cost Fn with tests
rconradharris authored May 17, 2011
571 class SchedulerCostFunctionNotFound(NotFound):
572 message = _("Scheduler cost function %(cost_fn_str)s could"
573 " not be found.")
574
439787e @rconradharris Pep8 fixes
rconradharris authored May 17, 2011
575
579bbde @rconradharris Merging in Sandy's changes adding Noop Cost Fn with tests
rconradharris authored May 17, 2011
576 class SchedulerWeightFlagNotFound(NotFound):
577 message = _("Scheduler weight flag not found: %(flag_name)s")
578
f50c726 @SandyWalsh tests and better driver loading
SandyWalsh authored May 3, 2011
579
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
580 class InstanceMetadataNotFound(NotFound):
581 message = _("Instance %(instance_id)s has no metadata with "
582 "key %(metadata_key)s.")
583
584
d68f6de Rename: intance_type_metadata -> instance_type_extra_specs
Lorin Hochstein authored Jun 16, 2011
585 class InstanceTypeExtraSpecsNotFound(NotFound):
586 message = _("Instance Type %(instance_type_id)s has no extra specs with "
587 "key %(extra_specs_key)s.")
65c2675 Adding accessor methods for instance type metadata
Lorin Hochstein authored May 27, 2011
588
589
8681db3 Addressing exception.NotFound across the project
Brian Waldon authored Apr 21, 2011
590 class LDAPObjectNotFound(NotFound):
591 message = _("LDAP object could not be found")
592
593
594 class LDAPUserNotFound(LDAPObjectNotFound):
595 message = _("LDAP user %(user_id)s could not be found.")
596
597
598 class LDAPGroupNotFound(LDAPObjectNotFound):
599 message = _("LDAP group %(group_id)s could not be found.")
600
601
602 class LDAPGroupMembershipNotFound(NotFound):
603 message = _("LDAP user %(user_id)s is not a member of group %(group_id)s.")
604
605
606 class FileNotFound(NotFound):
607 message = _("File %(file_path)s could not be found.")
608
609
610 class NoFilesFound(NotFound):
611 message = _("Zero files could be found.")
612
613
614 class SwitchNotFoundForNetworkAdapter(NotFound):
615 message = _("Virtual switch associated with the "
616 "network adapter %(adapter)s not found.")
617
618
619 class NetworkAdapterNotFound(NotFound):
620 message = _("Network adapter %(adapter)s could not be found.")
621
622
623 class ClassNotFound(NotFound):
624 message = _("Class %(class_name)s could not be found")
625
626
627 class NotAllowed(NovaException):
628 message = _("Action not allowed.")
629
630
631 class GlobalRoleNotAllowed(NotAllowed):
632 message = _("Unable to use global role %(role_id)s")
64f4032 merging trunk
Brian Waldon authored Apr 26, 2011
633
634
ab2a77d @rconradharris Adding backup rotation
rconradharris authored Jun 22, 2011
635 class ImageRotationNotAllowed(NovaException):
636 message = _("Rotation is not allowed for snapshots")
637
638
594d5c7 @jk0 Refactored backup rotate.
jk0 authored Jun 24, 2011
639 class RotationRequiredForBackup(NovaException):
640 message = _("Rotation param is required for backup image_type")
641
642
1378b11 refactoring usage of exception.Duplicate errors
Brian Waldon authored Apr 19, 2011
643 #TODO(bcwaldon): EOL this exception!
644 class Duplicate(NovaException):
645 pass
646
647
648 class KeyPairExists(Duplicate):
649 message = _("Key pair %(key_name)s already exists.")
650
651
652 class UserExists(Duplicate):
653 message = _("User %(user)s already exists.")
654
655
656 class LDAPUserExists(UserExists):
657 message = _("LDAP user %(user)s already exists.")
658
659
660 class LDAPGroupExists(Duplicate):
661 message = _("LDAP group %(group)s already exists.")
662
663
664 class LDAPMembershipExists(Duplicate):
665 message = _("User %(uid)s is already a member of "
666 "the group %(group_dn)s")
667
668
669 class ProjectExists(Duplicate):
670 message = _("Project %(project)s already exists.")
671
672
673 class InstanceExists(Duplicate):
674 message = _("Instance %(name)s already exists.")
8e6875e further cleanup of nova/exceptions.py
Brian Waldon authored Apr 27, 2011
675
676
677 class MigrationError(NovaException):
678 message = _("Migration error") + ": %(reason)s"
a3ddb45 Created new exception for handling malformed requests
Alex Meade authored Jun 14, 2011
679
680
681 class MalformedRequestBody(NovaException):
cf66a99 mp fixes
Alex Meade authored Jun 14, 2011
682 message = _("Malformed message body: %(reason)s")
927aecb Introduced Loader concept, for paste decouple.
Brian Lamar authored Jun 19, 2011
683
684
685 class PasteConfigNotFound(NotFound):
686 message = _("Could not find paste config at %(path)s")
687
688
689 class PasteAppNotFound(NotFound):
690 message = _("Could not load paste app '%(name)s' from %(path)s")
Something went wrong with that request. Please try again.