Revision 5c983ee5 lib/errors.py

b/lib/errors.py
22 22
"""Ganeti exception handling"""
23 23

  
24 24

  
25
# OpPrereqError failure types
26

  
27
# not enough resources (iallocator failure, disk space, memory, etc.)
28
ECODE_NORES = "insufficient_resources"
29
# wrong arguments (at syntax level)
30
ECODE_INVAL = "wrong_input"
31
# wrong entity state
32
ECODE_STATE = "wrong_state"
33
# entity not found
34
ECODE_NOENT = "unknown_entity"
35
# entity already exists
36
ECODE_EXISTS = "already_exists"
37
# resource not unique (e.g. MAC or IP duplication)
38
ECODE_NOTUNIQUE = "resource_not_unique"
39
# internal cluster error
40
ECODE_FAULT = "internal_error"
41
# environment error (e.g. node disk error)
42
ECODE_ENVIRON = "environment_error"
43

  
44

  
25 45
class GenericError(Exception):
26 46
  """Base exception for Ganeti.
27 47

  
......
125 145
class OpPrereqError(GenericError):
126 146
  """Prerequisites for the OpCode are not fulfilled.
127 147

  
148
  This exception will have either one or two arguments. For the
149
  two-argument construction, the second argument should be one of the
150
  ECODE_* codes.
151

  
128 152
  """
129 153

  
130 154

  

Also available in: Unified diff