mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-03 04:12:31 +01:00
bug 11434: don't execute destroy call when vm is already in Destroyed/Expunging state
status 11434: resolved fixed
This commit is contained in:
parent
ea97ce2a93
commit
b7f45cfbd6
@ -2910,10 +2910,15 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
|
||||
|
||||
// Verify input parameters
|
||||
UserVmVO vm = _vmDao.findById(vmId);
|
||||
if (vm == null) {
|
||||
if (vm == null || vm.getRemoved() != null) {
|
||||
throw new InvalidParameterValueException("Unable to find a virtual machine with id " + vmId);
|
||||
}
|
||||
}
|
||||
|
||||
if (vm.getState() == State.Destroyed || vm.getState() == State.Expunging) {
|
||||
s_logger.trace("Vm id=" + vmId + " is already destroyed");
|
||||
return vm;
|
||||
}
|
||||
|
||||
userId = accountAndUserValidation(vmId, account, userId, vm);
|
||||
User caller = _userDao.findById(userId);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user