@@ -108,7 +108,7 @@ def allocate(client, template):
108108
109109 Arguments
110110
111- ``` template` ``
111+ ``template``
112112 a string containing the template of the vm
113113 '''
114114 vm_id = client .call (VirtualMachine .METHODS ['allocate' ], template )
@@ -124,7 +124,7 @@ def deploy(self, host_id):
124124
125125 Arguments
126126
127- ``` host_id` ``
127+ ``host_id``
128128 the host id (hid) of the target host where the VM will be
129129 instantiated.
130130 '''
@@ -136,7 +136,7 @@ def migrate(self, dest_host):
136136
137137 Arguments
138138
139- ``` dest_host` ``
139+ ``dest_host``
140140 the target host id
141141 '''
142142 self .client .call (self .METHODS ['migrate' ], self .id , dest_host , False )
@@ -147,7 +147,7 @@ def live_migrate(self, dest_host):
147147
148148 Arguments
149149
150- ``` dest_host` ``
150+ ``dest_host``
151151 the target host id
152152 '''
153153 self .client .call (self .METHODS ['migrate' ], self .id , dest_host , True )
@@ -158,7 +158,7 @@ def save_disk(self, disk_id, dest_disk):
158158
159159 Arguments
160160
161- ``` disk_id` ``
161+ ``disk_id``
162162 disk id of the disk we want to save
163163 ``dest_disk``
164164 image id where the disk will be saved.
@@ -235,37 +235,37 @@ def __repr__(self):
235235 def str_state (self ):
236236 '''
237237 String representation of virtual machine state.
238- One of ' INIT', ' PENDING', ' HOLD', ' ACTIVE', ' STOPPED', ' SUSPENDED' ,
239- ' DONE', ' FAILED'
238+ One of: INIT, PENDING, HOLD, ACTIVE, STOPPED, SUSPENDED,
239+ DONE, FAILED
240240 '''
241241 return self .VM_STATE [int (self .state )]
242242
243243 @property
244244 def short_state (self ):
245245 '''
246246 Short string representation of virtual machine state.
247- One of ' init', ' pend', ' hold', ' actv', ' stop', ' susp', ' done', ' fail'
247+ One of: init, pend, hold, actv, stop, susp, done, fail
248248 '''
249249 return self .SHORT_VM_STATES [self .str_state ]
250250
251251 @property
252252 def str_lcm_state (self ):
253253 '''
254254 String representation of virtual machine LCM state.
255- One of ' LCM_INIT', ' PROLOG', ' BOOT', ' RUNNING', ' MIGRATE' ,
256- ' SAVE_STOP', ' SAVE_SUSPEND', ' SAVE_MIGRATE', ' PROLOG_MIGRATE' ,
257- ' PROLOG_RESUME', ' EPILOG_STOP', ' EPILOG', ' SHUTDOWN', ' CANCEL' ,
258- ' FAILURE', ' DELETE', ' UNKNOWN'
255+ One of: LCM_INIT, PROLOG, BOOT, RUNNING, MIGRATE,
256+ SAVE_STOP, SAVE_SUSPEND, SAVE_MIGRATE, PROLOG_MIGRATE,
257+ PROLOG_RESUME, EPILOG_STOP, EPILOG, SHUTDOWN, CANCEL,
258+ FAILURE, DELETE, UNKNOWN
259259 '''
260260 return self .LCM_STATE [int (self .lcm_state )]
261261
262262 @property
263263 def short_lcm_state (self ):
264264 '''
265265 Short string representation of virtual machine LCM state.
266- One of ' init', ' prol', ' boot', ' runn', ' migr', ' save', ' save' ,
267- ' save', ' migr', ' prol', ' epil', 'epil', ' shut', ' shut', ' fail' ,
268- ' dele', ' unkn'
266+ One of: init, prol, boot, runn, migr, save, save,
267+ save, migr, prol, epil, shut, shut, fail,
268+ dele, unkn
269269 '''
270270 return self .SHORT_LCM_STATES [self .str_lcm_state ]
271271
@@ -278,9 +278,9 @@ class VirtualMachinePool(Pool):
278278 def __init__ (self , client ):
279279 super (VirtualMachinePool , self ).__init__ ('VM_POOL' , 'VM' , client )
280280
281- def factory (self , xml ):
281+ def _factory (self , xml ):
282282 vm = VirtualMachine (xml , self .client )
283- vm .convert_types ()
283+ vm ._convert_types ()
284284 return vm
285285
286286 def info (self , filter = - 3 , range_start = - 1 , range_end = - 1 , vm_state = - 1 ):
@@ -297,17 +297,20 @@ def info(self, filter=-3, range_start=-1, range_end=-1, vm_state=-1):
297297 Range end ID. -1 for all
298298
299299 ``vm_state``
300+
300301 VM state to filter by.
301- -2 Any state, including DONE
302- -1 Any state, except DONE (Defualt)
303- 0 INIT
304- 1 PENDING
305- 2 HOLD
306- 3 ACTIVE
307- 4 STOPPED
308- 5 SUSPENDED
309- 6 DONE
310- 7 FAILED
302+
303+ * \-2 Any state, including DONE
304+ * \-1 Any state, except DONE (Defualt)
305+ * 0 INIT
306+ * 1 PENDING
307+ * 2 HOLD
308+ * 3 ACTIVE
309+ * 4 STOPPED
310+ * 5 SUSPENDED
311+ * 6 DONE
312+ * 7 FAILED
313+
311314 '''
312315 super (VirtualMachinePool , self ).info (filter , range_start ,
313316 range_end , vm_state )
0 commit comments