Hello ofri masad,
I'd like you to do a code review. Please visit
http://gerrit.ovirt.org/18521
to review the following change.
Change subject: core: Fix runUpdateMomPolicy in InitVdsOnUpCommand
......................................................................
core: Fix runUpdateMomPolicy in InitVdsOnUpCommand
The method used the wrong kind of return value.
Change-Id: Iac9ab4777f40813d180ca59abec0d8bc9b261e27
Signed-off-by: Ofri Masad <[email protected]>
---
M
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
1 file changed, 12 insertions(+), 9 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/18521/1
diff --git
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
index 04c0cff..022d7d7 100644
---
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
+++
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InitVdsOnUpCommand.java
@@ -47,6 +47,7 @@
import org.ovirt.engine.core.common.vdscommands.VdsIdVDSCommandParametersBase;
import
org.ovirt.engine.core.common.vdscommands.gluster.AddGlusterServerVDSParameters;
import org.ovirt.engine.core.compat.Guid;
+import org.ovirt.engine.core.compat.Version;
import org.ovirt.engine.core.dal.dbbroker.DbFacade;
import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AlertDirector;
import org.ovirt.engine.core.dal.dbbroker.auditloghandling.AuditLogDirector;
@@ -246,17 +247,19 @@
return result;
}
- private EventResult runUpdateMomPolicy(final VDSGroup cluster, final VDS
vds) {
- EventResult result = new EventResult(true, EventType.VDSCONNECTTOPOOL);
- try {
- runVdsCommand(VDSCommandType.SetMOMPolicyParameters,
- new MomPolicyVDSParameters(vds,
cluster.isEnableBallooning()));
- } catch (VdcBLLException e) {
- log.errorFormat("Could not update MoM policy on host {0}",
vds.getName());
- result.setSuccess(false);
+ private VDSReturnValue runUpdateMomPolicy(final VDSGroup cluster, final
VDS vds) {
+ VDSReturnValue returnValue = new VDSReturnValue();
+ if (cluster.getcompatibility_version().compareTo(Version.v3_3) >= 0) {
+ try {
+ returnValue =
runVdsCommand(VDSCommandType.SetMOMPolicyParameters,
+ new MomPolicyVDSParameters(vds,
cluster.isEnableBallooning()));
+ } catch (VdcBLLException e) {
+ log.errorFormat("Could not update MoM policy on host {0}",
vds.getName());
+ returnValue.setSucceeded(false);
+ }
}
- return result;
+ return returnValue;
}
protected boolean proceedVdsStats() {
--
To view, visit http://gerrit.ovirt.org/18521
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Iac9ab4777f40813d180ca59abec0d8bc9b261e27
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: ovirt-engine-3.3
Gerrit-Owner: Martin Sivák <[email protected]>
Gerrit-Reviewer: ofri masad <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches