mirror of https://github.com/apache/cloudstack.git
server: expunge if flag is set (#2825)
In integration work for CCS I found that the service call UserVmService.destroyVm(long uuid, boolean expunge) does not honour the expunge flag. I traced it down to the implementation VirtualMachineManagerImpl.destroy(String vmUuid, boolean expunge). Testing: manual testing so far, testing will pose some crosscutting challanges as the behaviour and implementation are seperated by about five layers of abstraction.
This commit is contained in:
parent
263559c19e
commit
eb3953f41a
|
|
@ -1890,6 +1890,13 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
if (!stateTransitTo(vm, VirtualMachine.Event.DestroyRequested, vm.getHostId())) {
|
||||
s_logger.debug("Unable to destroy the vm because it is not in the correct state: " + vm);
|
||||
throw new CloudRuntimeException("Unable to destroy " + vm);
|
||||
} else {
|
||||
if (expunge) {
|
||||
if (!stateTransitTo(vm, VirtualMachine.Event.ExpungeOperation, vm.getHostId())) {
|
||||
s_logger.debug("Unable to expunge the vm because it is not in the correct state: " + vm);
|
||||
throw new CloudRuntimeException("Unable to expunge " + vm);
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (final NoTransitionException e) {
|
||||
s_logger.debug(e.getMessage());
|
||||
|
|
|
|||
Loading…
Reference in New Issue