cc1  v2.1
CC1 source code docs
 All Classes Namespaces Files Functions Variables Pages
states.py
Go to the documentation of this file.
1 # -*- coding: utf-8 -*-
2 # @COPYRIGHT_begin
3 #
4 # Copyright [2010-2014] Institute of Nuclear Physics PAN, Krakow, Poland
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 # http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # @COPYRIGHT_end
19 
20 ##
21 # @package src.wi.utils.states
22 #
23 # @author Krzysztof Danielowski
24 # @author Piotr W√≥jcik
25 # @date 8.6.2010
26 #
27 # Module contains dictionaries translating between states and numbers.
28 #
29 
30 from django.utils.translation import ugettext_lazy as _
31 
32 from common.states import vm_states, node_states, image_access, image_types, \
33  image_platforms, image_states, message_levels, ec2names, \
34  cluster_states as cm_active, storage_states, \
35  available_network_states as pool_states
36 
37 
38 farm_states_reversed = {
39  0: _('Copying farm\'s head'),
40  1: _('Waiting for head\'s contextualization'),
41  2: _('Copying Worker Nodes'),
42  3: _('Running'),
43  4: _('Closing'),
44  5: _('Closed'),
45  6: _('Failed'),
46  7: _('Unconfigured'),
47  8: _('Configuring'),
48  9: _('Saving head')
49  }
50 
51 farm_descriptions_reversed = {
52  0: _('Farm\'s head is beeing copied, this could take a while depending on the image size'),
53  1: _('Waiting for head\'s contextualization. If the head\'s OS is running, but the farm remains in this state, this could indicate problem with contextualization. Image without contextualization can not be used to create farm. If this is a case please destroy the farm.'),
54  2: _('Worker Nodes are beeing copied, this could take a while depending on the image size'),
55  3: _('Farm is running'),
56  4: _('Closing'),
57  5: _('Closed'),
58  6: _('Farm failed'),
59  7: _('Farm could not be configured, passwordless communication between Head and WN is not guaranteed, the configuration script probably will not work correctly, you can still configure farm manually'),
60  8: _('Configuring worker nodes and waiting for contextualization'),
61  9: _('Saving farm\'s head')
62  }
63 
64 network_types_reversed = {
65  0: _('private'),
66  1: _('public'),
67  }
68 
69 user_active_reversed = {
70  0: _('inactive'),
71  1: _('email confirmed'),
72  2: _('active'),
73  3: _('blocked'),
74  }
75 
76 user_groups_states_reversed = {
77  0: _('pending'),
78  1: _('member'),
79  2: _('not a member'),
80  }
81 
82 vm_states_reversed = dict((v, k) for k, v in vm_states.iteritems())
83 
84 cm_active_reversed = dict((v, k) for k, v in cm_active.iteritems())
85 
86 node_states_reversed = dict((v, k) for k, v in node_states.iteritems())
87 
88 storage_states_reversed = dict((v, k) for k, v in storage_states.iteritems())
89 
90 image_access_reversed = dict((v, k) for k, v in image_access.iteritems())
91 
92 image_types_reversed = dict((v, k) for k, v in image_types.iteritems())
93 
94 image_platforms_reversed = dict((v, k) for k, v in image_platforms.iteritems())
95 
96 image_states_reversed = dict((v, k) for k, v in image_states.iteritems())
97 
98 message_levels_reversed = dict((v, k) for k, v in message_levels.iteritems())
99 
100 pool_states_reversed = dict((v, k) for k, v in pool_states.iteritems())
101 
102 ec2names_reversed = dict((v, k) for k, v in ec2names.iteritems())
103 
104 stat_names_reversed = {
105  0: _('CPU time'),
106  1: _('HDD read IO'),
107  2: _('HDD read bytes'),
108  3: _('HDD write IO'),
109  4: _('HDD write bytes'),
110  5: _('Network received bytes'),
111  6: _('Network received packets'),
112  7: _('Network sent bytes'),
113  8: _('Network sent packets'),
114  }
115 
116 stat_short_names_reversed = {
117  0: 'cpu_time',
118  1: 'rd_req',
119  2: 'rd_bytes',
120  3: 'wr_req',
121  4: 'wr_bytes',
122  5: 'rx_bytes',
123  6: 'rx_packets',
124  7: 'tx_bytes',
125  8: 'tx_packets',
126  }
127 
128 stat_resolutions_reversed = {
129  0: _('10 s'),
130  1: _('60 s'),
131  2: _('5 m'),
132  3: _('15 m'),
133  4: _('1 h'),
134  5: _('1 day'),
135  6: _('1 week'),
136  }
137 
138 stat_ranges_reversed = {
139  0: _('1 hour'),
140  1: _('6 hours'),
141  2: _('12 hours'),
142  3: _('1 day'),
143  4: _('1 week'),
144  5: _('1 month'),
145  6: _('1 year'),
146  }
147