File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,8 @@ def allocate(client, template):
177177 def __init__ (self , xml , client ):
178178 super (VirtualMachine , self ).__init__ (xml , client )
179179 self .id = self ['ID' ] if self ['ID' ] else None
180+ if client .one_version is None :
181+ client .version ()
180182
181183 def deploy (self , host_id ):
182184 """
@@ -229,13 +231,19 @@ def shutdown(self):
229231 """
230232 Shutdowns an already deployed VM
231233 """
232- self ._action ('shutdown' )
234+ if client .one_version >= '5' :
235+ self ._action ('terminate' )
236+ else :
237+ self ._action ('shutdown' )
233238
234239 def shutdown_hard (self ):
235240 """
236241 Shutdown hard an already deployed VM
237242 """
238- self ._action ('shutdown-hard' )
243+ if client .one_version >= '5' :
244+ self ._action ('terminate-hard' )
245+ else :
246+ self ._action ('shutdown-hard' )
239247
240248 def poweroff (self ):
241249 """
You can’t perform that action at this time.
0 commit comments