From d6cf594ef7e20c6c4ffdaa76c461efc9b99f704c Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Wed, 28 Mar 2012 13:50:03 -0700 Subject: [PATCH] bug 14292: don't try to reboot vm as part of resetVmPassword if the vm is in Stopped state status 14292: resolved fixed --- server/src/com/cloud/vm/UserVmManagerImpl.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java index 9e31629159e..b4e77aa2014 100755 --- a/server/src/com/cloud/vm/UserVmManagerImpl.java +++ b/server/src/com/cloud/vm/UserVmManagerImpl.java @@ -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 {