Commit b31d708a authored by Benziane Chakib's avatar Benziane Chakib
Browse files

Replaced useless constants for stop_vm method in the handler

parent 8ec88e17
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+2 −2
Original line number Diff line number Diff line
@@ -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)   

+0 −3
Original line number Diff line number Diff line
@@ -42,9 +42,6 @@ VM_START_STATES = {
    'paused' : 0
    }

SOFT_VM_POWEROFF = True
FORCE_VM_POWEROFF = False

# Storage Pools

POOL_STATE = (