File tree Expand file tree Collapse file tree 2 files changed +30
-31
lines changed
Expand file tree Collapse file tree 2 files changed +30
-31
lines changed Original file line number Diff line number Diff line change 115115
116116LOG = log .getLogger (__name__ )
117117
118- openstack_vm_statuses = {
119- "active" : "started" ,
120- "build" : "started" ,
121- "confirming_resize" : "started" ,
122- "deleted" : "completed" ,
123- "error" : "error" ,
124- "hard_reboot" : "started" ,
125- "migrating" : "started" ,
126- "password" : "started" ,
127- "paused" : "paused" ,
128- "reboot" : "started" ,
129- "rebuild" : "started" ,
130- "rescue" : "started" ,
131- "resize" : "started" ,
132- "revert_resize" : "started" ,
133- "verify_resize" : "started" ,
134- "shutoff" : "completed" ,
135- "suspended" : "suspended" ,
136- "terminated" : "completed" ,
137- "stopped" : "stopped" ,
138- "saving" : "started" ,
139- "unknown" : "unknown" ,
140- }
141-
142118
143119@six .add_metaclass (abc .ABCMeta )
144120class BaseProjectExtractor (object ):
@@ -182,13 +158,6 @@ def voms_map(self):
182158 voms_map [project ] = vo
183159 return voms_map
184160
185- def vm_status (self , status ):
186- """Return the status corresponding to the OpenStack status.
187-
188- :param status: OpenStack status.
189- """
190- return openstack_vm_statuses .get (status .lower (), "unknown" )
191-
192161 @abc .abstractmethod
193162 def extract (self , extract_from ):
194163 """Extract records for a project from given date.
Original file line number Diff line number Diff line change @@ -131,6 +131,36 @@ def _count_ips_on_server(self, server):
131131 count += 1
132132 return count
133133
134+ def vm_status (self , status ):
135+ """Return the status corresponding to the OpenStack status.
136+
137+ :param status: OpenStack status.
138+ """
139+ openstack_vm_statuses = {
140+ "active" : "started" ,
141+ "build" : "started" ,
142+ "confirming_resize" : "started" ,
143+ "deleted" : "completed" ,
144+ "error" : "error" ,
145+ "hard_reboot" : "started" ,
146+ "migrating" : "started" ,
147+ "password" : "started" ,
148+ "paused" : "paused" ,
149+ "reboot" : "started" ,
150+ "rebuild" : "started" ,
151+ "rescue" : "started" ,
152+ "resize" : "started" ,
153+ "revert_resize" : "started" ,
154+ "verify_resize" : "started" ,
155+ "shutoff" : "completed" ,
156+ "suspended" : "suspended" ,
157+ "terminated" : "completed" ,
158+ "stopped" : "stopped" ,
159+ "saving" : "started" ,
160+ "unknown" : "unknown" ,
161+ }
162+ return openstack_vm_statuses .get (status .lower (), "unknown" )
163+
134164 def _build_record (self , server ):
135165 user = self .users [server .user_id ]
136166
You can’t perform that action at this time.
0 commit comments