bug 14292: don't try to reboot vm as part of resetVmPassword if the vm is in Stopped state

status 14292: resolved fixed
This commit is contained in:
Alena Prokharchyk 2012-03-28 13:50:03 -07:00
parent 1adb426e58
commit d6cf594ef7
1 changed files with 6 additions and 5 deletions

View File

@ -472,11 +472,12 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
s_logger.debug("Failed to reset password for the virutal machine; no need to reboot the vm");
return false;
} else {
if (rebootVirtualMachine(userId, vmId) == null) {
if (vmInstance.getState() == State.Stopped) {
s_logger.debug("Vm " + vmInstance + " is stopped, not rebooting it as a part of password reset");
return true;
}
if (vmInstance.getState() == State.Stopped) {
s_logger.debug("Vm " + vmInstance + " is stopped, not rebooting it as a part of password reset");
return true;
}
if (rebootVirtualMachine(userId, vmId) == null) {
s_logger.warn("Failed to reboot the vm " + vmInstance);
return false;
} else {