Martin Peřina has uploaded a new change for review.

Change subject: core: Restore host status if pm action failed
......................................................................

core: Restore host status if pm action failed

Fixes restoring previous host status if power management start/stop
action failed.

Change-Id: I96fc99e2ffad639508a5923f268fa57ae312daa3
Bug-Url: https://bugzilla.redhat.com/1205589
Signed-off-by: Martin Perina <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/82/39182/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
index 94b184e..dadc4b3 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceVdsBaseCommand.java
@@ -23,6 +23,7 @@
 import org.ovirt.engine.core.common.businessentities.FenceStatusReturnValue;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
 import org.ovirt.engine.core.common.businessentities.VM;
+import org.ovirt.engine.core.common.businessentities.VdsDynamic;
 import org.ovirt.engine.core.common.businessentities.VdsStatic;
 import org.ovirt.engine.core.common.config.Config;
 import org.ovirt.engine.core.common.config.ConfigCommon;
@@ -613,7 +614,9 @@
     }
 
     protected void setStatus(VDSStatus status) {
-        if (getVds().getStatus() != status) {
+        // we need to load current status from db
+        VdsDynamic currentHost = 
getDbFacade().getVdsDynamicDao().get(getVds().getId());
+        if (currentHost != null && currentHost.getStatus() != status) {
             runVdsCommand(VDSCommandType.SetVdsStatus,
                             new 
SetVdsStatusVDSCommandParameters(getVds().getId(), status));
         }


-- 
To view, visit https://gerrit.ovirt.org/39182
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I96fc99e2ffad639508a5923f268fa57ae312daa3
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.5
Gerrit-Owner: Martin Peřina <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to