Ticket #6291 - CachedClusterObjects.Clear errors is being called even when there...
[ganeti_webmgr.git] / ganeti_web / constants.py
blob4cdca72879e35aacdcdbdc7bef5d45f285dd6229
1 # Copyright (C) 2010 Oregon State University et al.
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 # GNU General Public License for more details.
13 # You should have received a copy of the GNU General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
16 # USA.
18 VERSION = '0.6.2'
19 OWNER_TAG = 'gwm:owner:'
21 # Form Constants
22 EMPTY_CHOICE_FIELD = (u'', u'---------')
24 MODE_CHOICES = (
25 ('live','Live'),
26 ('non-live','Non-Live'),
29 NODE_ROLE_MAP = {
30 'M':'Master',
31 'C':'Master Candidate',
32 'R':'Regular',
33 'D':'Drained',
34 'O':'Offline',
37 ROLE_CHOICES = (
38 EMPTY_CHOICE_FIELD,
39 (u'master-candidate',u'Master Candidate'),
40 (u'regular',u'Regular'),
41 (u'drained',u'Drained'),
42 (u'offline',u'Offline'),
45 ROLE_MAP = {
46 'C':u'master-candidate',
47 'R':u'regular',
48 'D':u'drained',
49 'O':u'offline',
52 # KVM Choices
53 KVM_BOOT_ORDER = [
54 (u'disk', u'Hard Disk'),
55 (u'cdrom', u'CD-ROM'),
56 (u'network', u'Network'),
59 KVM_FLAGS = [
60 EMPTY_CHOICE_FIELD,
61 (u'enabled', u'Enabled'),
62 (u'disabled', u'Disabled'),
65 KVM_DISK_TYPES = [
66 (u'scsi', u'scsi'),
67 (u'sd', u'sd'),
68 (u'mtd', u'mtd'),
69 (u'pflash', u'pflash'),
72 KVM_NIC_TYPES = [
73 (u'i82551',u'i82551'),
74 (u'i82557b',u'i82557b'),
75 (u'i82559er',u'i82559er'),
76 (u'pcnet',u'pcnet'),
77 (u'e1000',u'e1000'),
80 # Xen HVM Choices
81 HVM_BOOT_ORDER = [
82 (u'cd', u'Hard Disk, CD-ROM'),
83 (u'a', u'Floppy Drive'),
84 (u'c', u'Hard Disk'),
85 (u'd', u'CD-ROM'),
86 (u'n', u'Network'),
89 HVM_DISK_TYPES = [
90 (u'ioemu', u'ioemu'),
93 # HV Choices
94 HV_DISK_TEMPLATES = [
95 EMPTY_CHOICE_FIELD,
96 (u'plain', u'plain'),
97 (u'drbd', u'drbd'),
98 (u'file', u'file'),
99 (u'diskless', u'diskless')
102 HV_DISK_TYPES = [
103 EMPTY_CHOICE_FIELD,
104 (u'paravirtual',u'paravirtual'),
105 (u'ide',u'ide'),
108 HV_NIC_MODES = [
109 EMPTY_CHOICE_FIELD,
110 (u'routed', u'routed'),
111 (u'bridged', u'bridged')
114 HV_NIC_TYPES = [
115 EMPTY_CHOICE_FIELD,
116 (u'rtl8139',u'rtl8139'),
117 (u'ne2k_isa',u'ne2k_isa'),
118 (u'ne2k_pci',u'ne2k_pci'),
119 (u'paravirtual',u'paravirtual'),
122 HV_BOOT_ORDER = KVM_BOOT_ORDER
124 HV_DISK_CACHES = [
125 (u'none',u'None'),
126 (u'default',u'Default'),
127 (u'writethrough',u'Writethrough'),
128 (u'writeback',u'Writeback'),
131 HV_SECURITY_MODELS = [
132 (u'none',u'None'),
133 (u'user',u'User'),
134 (u'pool',u'Pool'),
137 HV_USB_MICE = [
138 EMPTY_CHOICE_FIELD,
139 (u'mouse',u'Mouse'),
140 (u'tablet',u'Tablet'),
143 ALL_DISK_TYPES = HV_DISK_TYPES + KVM_DISK_TYPES + HVM_DISK_TYPES
144 ALL_NIC_TYPES = HV_NIC_TYPES + KVM_NIC_TYPES
145 ALL_BOOT_ORDER = KVM_BOOT_ORDER + HVM_BOOT_ORDER
147 KVM_CHOICES = {
148 'disk_type': HV_DISK_TYPES + KVM_DISK_TYPES,
149 'nic_type': HV_NIC_TYPES + KVM_NIC_TYPES,
150 'boot_order': KVM_BOOT_ORDER,
153 HVM_CHOICES = {
154 'disk_type': HV_DISK_TYPES + HVM_DISK_TYPES,
155 'nic_type': HV_NIC_TYPES,
156 'boot_order': HVM_BOOT_ORDER,
159 ALL_CHOICES = {
160 'disk_type': ALL_DISK_TYPES,
161 'nic_type': ALL_NIC_TYPES,
162 'boot_order': ALL_BOOT_ORDER,
165 NO_CHOICES = {
166 'disk_type': None,
167 'nic_type': None,
168 'boot_order': None,