server: allow expunging VMs in Expunging state (#219)

This commit is contained in:
Wei Zhou 2023-01-27 11:16:33 +01:00 committed by GitHub
parent 25460f05ab
commit 4382a33ab6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -3276,7 +3276,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager, Vir
throw new InvalidParameterValueException("unable to find a virtual machine with id " + vmId);
}
if ((vm.getState() == State.Destroyed && !expunge) || vm.getState() == State.Expunging) {
if (Arrays.asList(State.Destroyed, State.Expunging).contains(vm.getState()) && !expunge) {
s_logger.debug("Vm id=" + vmId + " is already destroyed");
return vm;
}