1
# Copyright 2012 Canonical Ltd. This software is licensed under the
2
# GNU Affero General Public License version 3 (see the file LICENSE).
4
"""Enumerations meaningful to the maasserver application."""
6
from __future__ import (
15
'ARCHITECTURE_CHOICES',
18
'NODE_STATUS_CHOICES',
19
'NODE_STATUS_CHOICES_DICT',
23
from collections import OrderedDict
27
"""The vocabulary of a `Node`'s possible statuses."""
28
# A node starts out as READY.
31
#: The node has been created and has a system ID assigned to it.
33
#: Testing and other commissioning steps are taking place.
35
#: Smoke or burn-in testing has a found a problem.
37
#: The node can't be contacted.
39
#: The node is in the general pool ready to be deployed.
41
#: The node is ready for named deployment.
43
#: The node is powering a service from a charm or is ready for use with
44
#: a fresh Ubuntu install.
46
#: The node has been removed from service manually until an admin
47
#: overrides the retirement.
51
# Django choices for NODE_STATUS: sequence of tuples (key, UI
53
NODE_STATUS_CHOICES = (
54
(NODE_STATUS.DECLARED, "Declared"),
55
(NODE_STATUS.COMMISSIONING, "Commissioning"),
56
(NODE_STATUS.FAILED_TESTS, "Failed tests"),
57
(NODE_STATUS.MISSING, "Missing"),
58
(NODE_STATUS.READY, "Ready"),
59
(NODE_STATUS.RESERVED, "Reserved"),
60
(NODE_STATUS.ALLOCATED, "Allocated"),
61
(NODE_STATUS.RETIRED, "Retired"),
65
NODE_STATUS_CHOICES_DICT = OrderedDict(NODE_STATUS_CHOICES)
68
class NODE_AFTER_COMMISSIONING_ACTION:
69
"""The vocabulary of a `Node`'s possible value for its field
70
after_commissioning_action.
73
# TODO: document this when it's stabilized.
84
NODE_AFTER_COMMISSIONING_ACTION_CHOICES = (
85
(NODE_AFTER_COMMISSIONING_ACTION.QUEUE,
86
"Queue for dynamic allocation to services"),
87
#(NODE_AFTER_COMMISSIONING_ACTION.CHECK,
88
# "Check compatibility and hold for future decision"),
89
#(NODE_AFTER_COMMISSIONING_ACTION.DEPLOY_12_04,
90
# "Deploy with Ubuntu 12.04 LTS"),
94
NODE_AFTER_COMMISSIONING_ACTION_CHOICES_DICT = dict(
95
NODE_AFTER_COMMISSIONING_ACTION_CHOICES)
99
"""List of supported architectures."""
106
# Architecture names.
107
ARCHITECTURE_CHOICES = (
108
(ARCHITECTURE.i386, "i386"),
109
(ARCHITECTURE.amd64, "amd64"),
113
class NODE_PERMISSION:
114
"""Permissions relating to nodes."""
121
"""Types of preseed documents that can be generated."""
123
COMMISSIONING = 'commissioning'