Commit b31d708a authored by Benziane Chakib's avatar Benziane Chakib

Replaced useless constants for stop_vm method in the handler

parent 8ec88e17
......@@ -155,7 +155,7 @@ class NodeHandler(RpcHandler):
return vms_info
@pure
def stop_vm(self, vm_names=None, stop_mode=SOFT_VM_POWEROFF):
def stop_vm(self, vm_names=None, force=False):
'''
Stop the specified list of vm names
This method do a soft shutdown on the Virtual Machine
......
......@@ -52,7 +52,7 @@ class KvmHypervisor(LibvirtHypervisor):
return
raise VMError('Virtual Machine %s not found: '% name)
def stop_vm(self, name, stop_mode=SOFT_VM_POWEROFF):
def stop_vm(self, name, force=False):
'''
Poweroff the specifed vm with the specified options
......@@ -61,7 +61,7 @@ class KvmHypervisor(LibvirtHypervisor):
'''
for vm in self._vm_list:
if vm.get_name() == name:
vm.shutdown() if stop_mode else vm.force_poweroff()
vm.force_poweroff() if force else vm.shutdown()
return
raise VMError('Virtual Machine %s not found: ' % name)
......
......@@ -42,9 +42,6 @@ VM_START_STATES = {
'paused' : 0
}
SOFT_VM_POWEROFF = True
FORCE_VM_POWEROFF = False
# Storage Pools
POOL_STATE = (
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment