21
21
'NODEGROUPINTERFACE_MANAGEMENT_CHOICES',
22
22
'NODEGROUPINTERFACE_MANAGEMENT_CHOICES_DICT',
25
26
'NODE_STATUS_CHOICES',
26
27
'NODE_STATUS_CHOICES_DICT',
52
54
#: Testing and other commissioning steps are taking place.
54
#: Smoke or burn-in testing has a found a problem.
56
#: The commissioning step failed.
57
FAILED_COMMISSIONING = 2
56
58
#: The node can't be contacted.
58
60
#: The node is in the general pool ready to be deployed.
60
62
#: The node is ready for named deployment.
62
#: The node is powering a service from a charm or is ready for use with
63
#: a fresh Ubuntu install.
64
#: The node has booted into the operating system of its owner's choice
65
#: and is ready for use.
65
67
#: The node has been removed from service manually until an admin
66
68
#: overrides the retirement.
68
70
#: The node is broken: a step in the node lifecyle failed.
69
71
#: More details can be found in the node's event log.
73
#: The node is being installed.
75
#: The node has been allocated to a user and is ready for deployment.
77
#: The deployment of the node failed.
78
FAILED_DEPLOYMENT = 11
79
#: The node is powering down after a release request.
81
#: The releasing of the node failed.
83
#: The node is erasing its disks.
85
#: The node failed to erase its disks.
86
FAILED_DISK_ERASING = 15
73
89
# Django choices for NODE_STATUS: sequence of tuples (key, UI
75
91
NODE_STATUS_CHOICES = (
76
92
(NODE_STATUS.NEW, "New"),
77
93
(NODE_STATUS.COMMISSIONING, "Commissioning"),
78
(NODE_STATUS.FAILED_TESTS, "Failed tests"),
94
(NODE_STATUS.FAILED_COMMISSIONING, "Failed commissioning"),
79
95
(NODE_STATUS.MISSING, "Missing"),
80
96
(NODE_STATUS.READY, "Ready"),
81
97
(NODE_STATUS.RESERVED, "Reserved"),
82
98
(NODE_STATUS.ALLOCATED, "Allocated"),
99
(NODE_STATUS.DEPLOYING, "Deploying"),
100
(NODE_STATUS.DEPLOYED, "Deployed"),
83
101
(NODE_STATUS.RETIRED, "Retired"),
84
102
(NODE_STATUS.BROKEN, "Broken"),
103
(NODE_STATUS.FAILED_DEPLOYMENT, "Failed deployment"),
104
(NODE_STATUS.RELEASING, "Releasing"),
105
(NODE_STATUS.FAILED_RELEASING, "Releasing failed"),
106
(NODE_STATUS.DISK_ERASING, "Disk erasing"),
107
(NODE_STATUS.FAILED_DISK_ERASING, "Failed disk erasing"),
171
class NODEGROUP_STATE:
172
"""The vocabulary of a `NodeGroup`'s possible state."""
174
DISCONNECTED = "Disconnected"
176
OUT_OF_SYNC = "Out-of-sync"
148
183
class NODEGROUPINTERFACE_MANAGEMENT:
149
184
"""The vocabulary of a `NodeGroupInterface`'s possible statuses."""
150
185
# A nodegroupinterface starts out as UNMANAGED.
162
197
# representation).
163
198
NODEGROUPINTERFACE_MANAGEMENT_CHOICES = (
164
199
(NODEGROUPINTERFACE_MANAGEMENT.UNMANAGED, "Unmanaged"),
165
(NODEGROUPINTERFACE_MANAGEMENT.DHCP, "Manage DHCP"),
166
(NODEGROUPINTERFACE_MANAGEMENT.DHCP_AND_DNS, "Manage DHCP and DNS"),
200
(NODEGROUPINTERFACE_MANAGEMENT.DHCP, "DHCP"),
201
(NODEGROUPINTERFACE_MANAGEMENT.DHCP_AND_DNS, "DHCP and DNS"),
271
BOOT_RESOURCE_TYPE_CHOICES_DICT = OrderedDict(BOOT_RESOURCE_TYPE_CHOICES)
236
274
class BOOT_RESOURCE_FILE_TYPE:
237
275
"""The vocabulary of possible file types for `BootResource`."""
238
276
#: Tarball of root image.
277
ROOT_TGZ = 'root-tgz'
241
279
#: Tarball of dd image.
244
282
# Following are not allowed on user upload. Only used for syncing
245
283
# from another simplestreams source. (Most likely maas.ubuntu.com)
263
301
# Django choices for BOOT_RESOURCE_FILE_TYPE: sequence of tuples (key, UI
264
302
# representation).
265
303
BOOT_RESOURCE_FILE_TYPE_CHOICES = (
266
(BOOT_RESOURCE_FILE_TYPE.TGZ, "Root Image (tar.gz)"),
267
(BOOT_RESOURCE_FILE_TYPE.DDTGZ, "Root Compreseed DD (dd -> tar.gz)"),
304
(BOOT_RESOURCE_FILE_TYPE.ROOT_TGZ, "Root Image (tar.gz)"),
305
(BOOT_RESOURCE_FILE_TYPE.ROOT_DD, "Root Compressed DD (dd -> tar.gz)"),
268
306
(BOOT_RESOURCE_FILE_TYPE.ROOT_IMAGE, "Compressed Root Image"),
269
307
(BOOT_RESOURCE_FILE_TYPE.BOOT_KERNEL, "Linux ISCSI Kernel"),
270
308
(BOOT_RESOURCE_FILE_TYPE.BOOT_INITRD, "Initial ISCSI Ramdisk"),
271
309
(BOOT_RESOURCE_FILE_TYPE.DI_KERNEL, "Linux DI Kernel"),
272
310
(BOOT_RESOURCE_FILE_TYPE.DI_INITRD, "Initial DI Ramdisk"),
276
# Django choices for BOOT_RESOURCE_FILE_TYPE: sequence of tuples (key, UI
277
# representation). (Choices allowed for user uploading.)
278
BOOT_RESOURCE_FILE_TYPE_CHOICES_UPLOAD = (
279
(BOOT_RESOURCE_FILE_TYPE.TGZ, "Root Image (tar.gz)"),
280
(BOOT_RESOURCE_FILE_TYPE.DDTGZ, "Root Compreseed DD (dd -> tar.gz)"),