Revision 88ac4075
b/autotools/convert-constants | ||
---|---|---|
298 | 298 |
|
299 | 299 |
|
300 | 300 |
def main(): |
301 |
print Convert(errors, "errors") |
|
302 | 301 |
print Convert(jstore, "jstore") |
303 | 302 |
|
304 | 303 |
|
b/lib/errors.py | ||
---|---|---|
23 | 23 |
|
24 | 24 |
""" |
25 | 25 |
|
26 |
from ganeti import compat |
|
27 |
|
|
28 |
|
|
29 |
# OpPrereqError failure types |
|
30 |
|
|
31 |
#: Resolver errors |
|
32 |
ECODE_RESOLVER = "resolver_error" |
|
33 |
|
|
34 |
#: Not enough resources (iallocator failure, disk space, memory, etc.) |
|
35 |
ECODE_NORES = "insufficient_resources" |
|
36 |
|
|
37 |
#: Temporarily out of resources; operation can be tried again |
|
38 |
ECODE_TEMP_NORES = "temp_insufficient_resources" |
|
39 |
|
|
40 |
#: Wrong arguments (at syntax level) |
|
41 |
ECODE_INVAL = "wrong_input" |
|
42 |
|
|
43 |
#: Wrong entity state |
|
44 |
ECODE_STATE = "wrong_state" |
|
45 |
|
|
46 |
#: Entity not found |
|
47 |
ECODE_NOENT = "unknown_entity" |
|
48 |
|
|
49 |
#: Entity already exists |
|
50 |
ECODE_EXISTS = "already_exists" |
|
51 |
|
|
52 |
#: Resource not unique (e.g. MAC or IP duplication) |
|
53 |
ECODE_NOTUNIQUE = "resource_not_unique" |
|
54 |
|
|
55 |
#: Internal cluster error |
|
56 |
ECODE_FAULT = "internal_error" |
|
57 |
|
|
58 |
#: Environment error (e.g. node disk error) |
|
59 |
ECODE_ENVIRON = "environment_error" |
|
60 |
|
|
61 |
#: List of all failure types |
|
62 |
ECODE_ALL = compat.UniqueFrozenset([ |
|
63 |
ECODE_RESOLVER, |
|
64 |
ECODE_NORES, |
|
65 |
ECODE_TEMP_NORES, |
|
66 |
ECODE_INVAL, |
|
67 |
ECODE_STATE, |
|
68 |
ECODE_NOENT, |
|
69 |
ECODE_EXISTS, |
|
70 |
ECODE_NOTUNIQUE, |
|
71 |
ECODE_FAULT, |
|
72 |
ECODE_ENVIRON, |
|
73 |
]) |
|
26 |
from ganeti import constants |
|
27 |
|
|
28 |
|
|
29 |
ECODE_RESOLVER = constants.ERRORS_ECODE_RESOLVER |
|
30 |
ECODE_NORES = constants.ERRORS_ECODE_NORES |
|
31 |
ECODE_TEMP_NORES = constants.ERRORS_ECODE_TEMP_NORES |
|
32 |
ECODE_INVAL = constants.ERRORS_ECODE_INVAL |
|
33 |
ECODE_STATE = constants.ERRORS_ECODE_STATE |
|
34 |
ECODE_NOENT = constants.ERRORS_ECODE_NOENT |
|
35 |
ECODE_EXISTS = constants.ERRORS_ECODE_EXISTS |
|
36 |
ECODE_NOTUNIQUE = constants.ERRORS_ECODE_NOTUNIQUE |
|
37 |
ECODE_FAULT = constants.ERRORS_ECODE_FAULT |
|
38 |
ECODE_ENVIRON = constants.ERRORS_ECODE_ENVIRON |
|
39 |
ECODE_ALL = constants.ERRORS_ECODE_ALL |
|
74 | 40 |
|
75 | 41 |
|
76 | 42 |
class GenericError(Exception): |
b/src/Ganeti/HsConstants.hs | ||
---|---|---|
4490 | 4490 |
-- | Characters used to detect globbing filters |
4491 | 4491 |
qlangGlobDetectionChars :: FrozenSet String |
4492 | 4492 |
qlangGlobDetectionChars = ConstantUtils.mkSet ["*", "?"] |
4493 |
|
|
4494 |
-- * Error related constants |
|
4495 |
-- |
|
4496 |
-- 'OpPrereqError' failure types |
|
4497 |
|
|
4498 |
-- | Environment error (e.g. node disk error) |
|
4499 |
errorsEcodeEnviron :: String |
|
4500 |
errorsEcodeEnviron = "environment_error" |
|
4501 |
|
|
4502 |
-- | Entity already exists |
|
4503 |
errorsEcodeExists :: String |
|
4504 |
errorsEcodeExists = "already_exists" |
|
4505 |
|
|
4506 |
-- | Internal cluster error |
|
4507 |
errorsEcodeFault :: String |
|
4508 |
errorsEcodeFault = "internal_error" |
|
4509 |
|
|
4510 |
-- | Wrong arguments (at syntax level) |
|
4511 |
errorsEcodeInval :: String |
|
4512 |
errorsEcodeInval = "wrong_input" |
|
4513 |
|
|
4514 |
-- | Entity not found |
|
4515 |
errorsEcodeNoent :: String |
|
4516 |
errorsEcodeNoent = "unknown_entity" |
|
4517 |
|
|
4518 |
-- | Not enough resources (iallocator failure, disk space, memory, etc) |
|
4519 |
errorsEcodeNores :: String |
|
4520 |
errorsEcodeNores = "insufficient_resources" |
|
4521 |
|
|
4522 |
-- | Resource not unique (e.g. MAC or IP duplication) |
|
4523 |
errorsEcodeNotunique :: String |
|
4524 |
errorsEcodeNotunique = "resource_not_unique" |
|
4525 |
|
|
4526 |
-- | Resolver errors |
|
4527 |
errorsEcodeResolver :: String |
|
4528 |
errorsEcodeResolver = "resolver_error" |
|
4529 |
|
|
4530 |
-- | Wrong entity state |
|
4531 |
errorsEcodeState :: String |
|
4532 |
errorsEcodeState = "wrong_state" |
|
4533 |
|
|
4534 |
-- | Temporarily out of resources; operation can be tried again |
|
4535 |
errorsEcodeTempNores :: String |
|
4536 |
errorsEcodeTempNores = "temp_insufficient_resources" |
|
4537 |
|
|
4538 |
errorsEcodeAll :: FrozenSet String |
|
4539 |
errorsEcodeAll = |
|
4540 |
ConstantUtils.mkSet [ errorsEcodeNores |
|
4541 |
, errorsEcodeExists |
|
4542 |
, errorsEcodeState |
|
4543 |
, errorsEcodeNotunique |
|
4544 |
, errorsEcodeTempNores |
|
4545 |
, errorsEcodeNoent |
|
4546 |
, errorsEcodeFault |
|
4547 |
, errorsEcodeResolver |
|
4548 |
, errorsEcodeInval |
|
4549 |
, errorsEcodeEnviron |
|
4550 |
] |
Also available in: Unified diff