Oved Ourfali has uploaded a new change for review.

Change subject: core: fix fence-status operation
......................................................................

core: fix fence-status operation

When the fencing policy is null, we check that the host is compatible
with cluster level 3.0, which is wrong. This patch changes that by
returning null from the method in case we have null fencing policy.

Change-Id: Idecf91da729cbd8744f894c341b7044cc791853d
Bug-Url: https://bugzilla.redhat.com/1130791
Signed-off-by: Oved Ourfali <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/FencingPolicyHelper.java
2 files changed, 5 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/75/31575/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
index 30afdd9..9dcca9b 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/FenceExecutor.java
@@ -424,7 +424,9 @@
                 }
 
                 // check if host supports minimal cluster level needed by 
fencing policy
-                ret = ret && 
_vds.getSupportedClusterVersionsSet().contains(minVersionSupportingFencingPol);
+                if (minVersionSupportingFencingPol != null) {
+                    ret = ret && 
_vds.getSupportedClusterVersionsSet().contains(minVersionSupportingFencingPol);
+                }
 
                 return ret;
             }
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/FencingPolicyHelper.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/FencingPolicyHelper.java
index dbd4a2c..28cc1bf 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/FencingPolicyHelper.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/utils/FencingPolicyHelper.java
@@ -12,11 +12,12 @@
 public class FencingPolicyHelper {
     /**
      * Returns minimal cluster version, that supports specified fencing policy
+     * If the policy is null we return null as well.
      */
     public static Version getMinimalSupportedVersion(FencingPolicy fp) {
         // Version 2.2 is not supported by VDSM, but it's still contained in 
version list,
         // so we cannot just get first element from version list
-        Version ver = Version.v3_0;
+        Version ver = null;
         if (fp != null) {
             if (fp.isSkipFencingIfSDActive()) {
                 for (Version v : Version.ALL) {


-- 
To view, visit http://gerrit.ovirt.org/31575
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idecf91da729cbd8744f894c341b7044cc791853d
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Oved Ourfali <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to