Ramesh N has uploaded a new change for review.

Change subject: gluster: enable new gluster features using new feature check
......................................................................

gluster: enable new gluster features using new feature check

  Enabling the new gluster features like snapshot managment,
geo replication, brick provisioning based on new feature
compatibility check. With this, above features will be
supported in 3.5 cluster as well.

Change-Id: I9074a500caa1b5a30cea19e9fa4420e12d3fa6a1
Signed-off-by: Ramesh Nachimuthu <rnach...@redhat.com>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJob.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJob.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJob.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SyncStorageDevicesCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/UpdateGlusterVolumeSnapshotConfigCommand.java
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommandTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommandTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJobTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJobTest.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJobTest.java
M 
frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterFeaturesUtil.java
15 files changed, 92 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/21/40921/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommand.java
index 403b244..be487b1 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommand.java
@@ -7,6 +7,7 @@
 import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
 import org.ovirt.engine.core.bll.VdsCommand;
 import org.ovirt.engine.core.bll.VdsValidator;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.LockProperties;
 import org.ovirt.engine.core.common.action.LockProperties.Scope;
@@ -49,7 +50,9 @@
     protected boolean canDoAction() {
         VDSGroup cluster = getVdsGroup();
         if (!cluster.supportsGlusterService()
-                || 
!GlusterFeatureSupported.glusterBrickProvisioning(cluster.getCompatibilityVersion()))
 {
+                || 
(!GlusterFeatureSupported.glusterBrickProvisioning(cluster.getCompatibilityVersion())
+                && 
!getClusterUtils().isFeatureSupportedAsAdditionalFeature(getVdsGroup().getId(),
+                        ClusterUtils.FEATURE_GLUSTER_BRICK_MANAGEMENT))) {
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER);
         }
 
@@ -153,4 +156,8 @@
     public AuditLogType getAuditLogTypeValue() {
         return getSucceeded() ? AuditLogType.CREATE_GLUSTER_BRICK : 
AuditLogType.CREATE_GLUSTER_BRICK_FAILED;
     }
+
+    protected ClusterUtils getClusterUtils() {
+        return ClusterUtils.getInstance();
+    }
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java
index 2a65f4b..a402eb2 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommand.java
@@ -8,6 +8,7 @@
 import java.util.concurrent.Callable;
 
 import org.ovirt.engine.core.bll.context.CommandContext;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.VdcActionType;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
@@ -48,7 +49,9 @@
 
     @Override
     protected boolean canDoAction() {
-        if 
(!GlusterFeatureSupported.glusterGeoReplication(getVdsGroup().getCompatibilityVersion()))
 {
+        if 
(!GlusterFeatureSupported.glusterGeoReplication(getVdsGroup().getCompatibilityVersion())
+                && 
!getClusterUtils().isFeatureSupportedAsAdditionalFeature(getVdsGroup().getId(),
+                        ClusterUtils.FEATURE_GLUSTER_GEO_REPLICATION)) {
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_GEO_REP_NOT_SUPPORTED);
         }
         slaveHost = getSlaveHost();
@@ -230,4 +233,8 @@
         }
         return remoteServers;
     }
+
+    protected ClusterUtils getClusterUtils() {
+        return ClusterUtils.getInstance();
+    }
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJob.java
index c15808b..f171168 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJob.java
@@ -9,6 +9,7 @@
 
 import org.apache.commons.collections.CollectionUtils;
 import org.apache.commons.lang.ArrayUtils;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
@@ -464,7 +465,9 @@
 
     private boolean supportsGlusterGeoRepFeature(VDSGroup cluster) {
         return cluster.supportsGlusterService()
-                && 
GlusterFeatureSupported.glusterGeoReplication(cluster.getCompatibilityVersion());
+                && 
(GlusterFeatureSupported.glusterGeoReplication(cluster.getCompatibilityVersion())
 || getClusterUtils()
+                        .isFeatureSupportedAsAdditionalFeature(cluster.getId(),
+                                ClusterUtils.FEATURE_GLUSTER_GEO_REPLICATION));
     }
 
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
index ee02222..19acc61 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotCommandBase.java
@@ -4,6 +4,7 @@
 import java.util.Map;
 
 import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.action.LockProperties;
 import org.ovirt.engine.core.common.action.LockProperties.Scope;
 import org.ovirt.engine.core.common.action.gluster.GlusterVolumeParameters;
@@ -40,7 +41,9 @@
             return false;
         }
 
-        if 
(!GlusterFeatureSupported.glusterSnapshot(getVdsGroup().getCompatibilityVersion()))
 {
+        if 
(!GlusterFeatureSupported.glusterSnapshot(getVdsGroup().getCompatibilityVersion())
+                && 
!ClusterUtils.getInstance().isFeatureSupportedAsAdditionalFeature(getVdsGroup().getId(),
+                        ClusterUtils.FEATURE_GLUSTER_SNAPSHOT)) {
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED);
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJob.java
index c0a6b86..e8e31ab 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJob.java
@@ -5,6 +5,7 @@
 import java.util.List;
 import java.util.Map;
 
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
 import 
org.ovirt.engine.core.common.businessentities.gluster.GlusterSnapshotConfigInfo;
@@ -252,7 +253,9 @@
 
     private boolean supportsGlusterSnapshotFeature(VDSGroup cluster) {
         return cluster.supportsGlusterService()
-                && 
GlusterFeatureSupported.glusterSnapshot(cluster.getCompatibilityVersion());
+                && 
(GlusterFeatureSupported.glusterSnapshot(cluster.getCompatibilityVersion()) || 
getClusterUtils()
+                        .isFeatureSupportedAsAdditionalFeature(cluster.getId(),
+                        ClusterUtils.FEATURE_GLUSTER_SNAPSHOT));
     }
 
     protected GlusterVolumeDao getGlusterVolumeDao() {
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJob.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJob.java
index 0178fcc..4a1f000 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJob.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJob.java
@@ -13,6 +13,7 @@
 import javax.inject.Singleton;
 
 import org.apache.commons.lang.StringUtils;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
@@ -180,7 +181,9 @@
 
     private boolean supportsGlusterDiskProvisioning(VDSGroup cluster) {
         return cluster.supportsGlusterService()
-                && 
GlusterFeatureSupported.glusterBrickProvisioning(cluster.getCompatibilityVersion());
+                && 
(GlusterFeatureSupported.glusterBrickProvisioning(cluster.getCompatibilityVersion())
 || getClusterUtils()
+                        .isFeatureSupportedAsAdditionalFeature(cluster.getId(),
+                                
ClusterUtils.FEATURE_GLUSTER_BRICK_MANAGEMENT));
     }
 
 }
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SyncStorageDevicesCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SyncStorageDevicesCommand.java
index 07d549a..c3c0b87 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SyncStorageDevicesCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/SyncStorageDevicesCommand.java
@@ -4,6 +4,7 @@
 
 import org.ovirt.engine.core.bll.VdsCommand;
 import org.ovirt.engine.core.bll.VdsValidator;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.VdsActionParameters;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
@@ -21,7 +22,9 @@
     protected boolean canDoAction() {
         VDSGroup cluster = getVdsGroup();
         if (!cluster.supportsGlusterService()
-                || 
!GlusterFeatureSupported.glusterBrickProvisioning(cluster.getCompatibilityVersion()))
 {
+                || 
!GlusterFeatureSupported.glusterBrickProvisioning(cluster.getCompatibilityVersion())
+                && 
!ClusterUtils.getInstance().isFeatureSupportedAsAdditionalFeature(getVdsGroup().getId(),
+                        ClusterUtils.FEATURE_GLUSTER_BRICK_MANAGEMENT)) {
             return 
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_PROVISIONING_NOT_SUPPORTED_BY_CLUSTER);
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/UpdateGlusterVolumeSnapshotConfigCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/UpdateGlusterVolumeSnapshotConfigCommand.java
index d30e455..59dcb0e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/UpdateGlusterVolumeSnapshotConfigCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/gluster/UpdateGlusterVolumeSnapshotConfigCommand.java
@@ -8,6 +8,7 @@
 
 import org.apache.commons.lang.StringUtils;
 import org.ovirt.engine.core.bll.LockMessagesMatchUtil;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.AuditLogType;
 import org.ovirt.engine.core.common.action.LockProperties;
 import org.ovirt.engine.core.common.action.LockProperties.Scope;
@@ -56,7 +57,9 @@
             return false;
         }
 
-        if 
(!GlusterFeatureSupported.glusterSnapshot(getVdsGroup().getCompatibilityVersion()))
 {
+        if 
(!GlusterFeatureSupported.glusterSnapshot(getVdsGroup().getCompatibilityVersion())
+                && 
!ClusterUtils.getInstance().isFeatureSupportedAsAdditionalFeature(getVdsGroup().getId(),
+                        ClusterUtils.FEATURE_GLUSTER_SNAPSHOT)) {
             
failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VOLUME_SNAPSHOT_NOT_SUPPORTED);
         }
 
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java
index d45372a..42c5d77 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/utils/ClusterUtils.java
@@ -2,7 +2,9 @@
 
 import java.util.List;
 import java.util.Random;
+import java.util.Set;
 
+import 
org.ovirt.engine.core.common.businessentities.SupportedAdditionalClusterFeature;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSStatus;
 import org.ovirt.engine.core.common.businessentities.VM;
@@ -10,10 +12,15 @@
 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.dao.ClusterFeatureDao;
 import org.ovirt.engine.core.dao.VdsDAO;
 import org.ovirt.engine.core.dao.VdsGroupDAO;
 
 public class ClusterUtils {
+
+    public static String FEATURE_GLUSTER_GEO_REPLICATION = 
"GLUSTER_GEO_REPLICATION";
+    public static String FEATURE_GLUSTER_SNAPSHOT = "GLUSTER_SNAPSHOT";
+    public static String FEATURE_GLUSTER_BRICK_MANAGEMENT = 
"GLUSTER_BRICK_MANAGEMENT";
 
     private static ClusterUtils instance = new ClusterUtils();
 
@@ -89,4 +96,22 @@
     public VdsGroupDAO getVdsGroupDao() {
         return DbFacade.getInstance().getVdsGroupDao();
     }
+
+    /**
+     * Checks if the given features is supported as additional feature in the 
cluster
+     *
+     * @param clusterId
+     * @param featureName
+     * @return
+     */
+    public boolean isFeatureSupportedAsAdditionalFeature(Guid clusterId, 
String featureName) {
+        ClusterFeatureDao clusterFeatureDao = 
DbFacade.getInstance().getClusterFeatureDao();
+        Set<SupportedAdditionalClusterFeature> addtionalFeaturesSupported = 
clusterFeatureDao.getSupportedFeaturesByClusterId(clusterId);
+        for (SupportedAdditionalClusterFeature supportedFeature : 
addtionalFeaturesSupported) {
+            if (supportedFeature.getFeature().getName().equals(featureName)) {
+                return supportedFeature.isEnabled();
+            }
+        }
+        return false;
+    }
 }
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommandTest.java
index e47fa36..5b674b7 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommandTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateBrickCommandTest.java
@@ -2,6 +2,8 @@
 
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.when;
@@ -15,6 +17,7 @@
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import org.ovirt.engine.core.common.action.gluster.CreateBrickParameters;
 import org.ovirt.engine.core.common.businessentities.RaidType;
 import org.ovirt.engine.core.common.businessentities.VDS;
@@ -34,6 +37,9 @@
 
     @Mock
     private VDS vds;
+
+    @Mock
+    private ClusterUtils clusterUtils;
 
     @Mock
     private VDSGroup vdsGroup;
@@ -133,6 +139,8 @@
         doReturn(vds).when(command).getVds();
         doReturn(status).when(vds).getStatus();
         mockIsGlusterEnabled(true);
+        doReturn(clusterUtils).when(command).getClusterUtils();
+        
when(clusterUtils.isFeatureSupportedAsAdditionalFeature(any(Guid.class), 
anyString())).thenReturn(false);
         mockCompatibilityVersion(Version.v3_6);
     }
 
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommandTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommandTest.java
index 41c3bf9..442f7ab 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommandTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/CreateGlusterVolumeGeoRepSessionCommandTest.java
@@ -2,8 +2,10 @@
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.when;
 import static org.ovirt.engine.core.utils.MockConfigRule.mockConfig;
 
 import org.junit.ClassRule;
@@ -11,6 +13,7 @@
 import org.junit.runner.RunWith;
 import org.mockito.Mock;
 import org.mockito.runners.MockitoJUnitRunner;
+import org.ovirt.engine.core.bll.utils.ClusterUtils;
 import 
org.ovirt.engine.core.common.action.gluster.GlusterVolumeGeoRepSessionParameters;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.VDSGroup;
@@ -61,6 +64,9 @@
     protected VDSGroup vdsGroup;
 
     @Mock
+    private ClusterUtils clusterUtils;
+
+    @Mock
     protected GlusterVolumeEntity volume;
 
     @Mock
@@ -93,6 +99,8 @@
         doReturn(geoRepDao).when(command).getGeoRepDao();
         doReturn(vds).when(command).getUpServer();
         doReturn(VDSStatus.Up).when(vds).getStatus();
+        doReturn(clusterUtils).when(command).getClusterUtils();
+        
when(clusterUtils.isFeatureSupportedAsAdditionalFeature(any(Guid.class), 
anyString())).thenReturn(false);
     }
 
     @Test
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJobTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJobTest.java
index 4489d22..b9229ea 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJobTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterGeoRepSyncJobTest.java
@@ -1,9 +1,11 @@
 package org.ovirt.engine.core.bll.gluster;
 
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.when;
 import static org.ovirt.engine.core.utils.MockConfigRule.mockConfig;
 
 import java.util.ArrayList;
@@ -89,6 +91,7 @@
         doReturn(getVolume()).when(volumeDao).getByName(any(Guid.class), 
any(String.class));
         doReturn(getVolume()).when(volumeDao).getById(any(Guid.class));
         
doReturn(getServer()).when(clusterUtils).getRandomUpServer(any(Guid.class));
+        
when(clusterUtils.isFeatureSupportedAsAdditionalFeature(any(Guid.class), 
anyString())).thenReturn(false);
         
doReturn(getMockLock()).when(syncJob).acquireGeoRepSessionLock(any(Guid.class));
         doReturn(getSessions(2, 
true)).when(geoRepDao).getGeoRepSessionsInCluster(CLUSTER_GUIDS[1]);
     }
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJobTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJobTest.java
index a35bb28..a7fe33b 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJobTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/GlusterSnapshotSyncJobTest.java
@@ -1,10 +1,12 @@
 package org.ovirt.engine.core.bll.gluster;
 
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.argThat;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.when;
 import static org.ovirt.engine.core.utils.MockConfigRule.mockConfig;
 
 import java.util.ArrayList;
@@ -116,7 +118,7 @@
         doReturn(getVolume(CLUSTER_ID_1, VOLUME_ID_1, 
VOLUME_NAME_1)).when(volumeDao)
                 .getByName(argThat(validClusterId()), 
argThat(validVolumeName()));
         
doReturn(getServer()).when(clusterUtils).getRandomUpServer(any(Guid.class));
-
+        
when(clusterUtils.isFeatureSupportedAsAdditionalFeature(any(Guid.class), 
anyString())).thenReturn(false);
         
doReturn(engineLock).when(syncJob).acquireVolumeSnapshotLock(any(Guid.class));
     }
 
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJobTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJobTest.java
index 43f078e..466423b 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJobTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/gluster/StorageDeviceSyncJobTest.java
@@ -1,10 +1,12 @@
 package org.ovirt.engine.core.bll.gluster;
 
 import static org.mockito.Matchers.any;
+import static org.mockito.Matchers.anyString;
 import static org.mockito.Matchers.argThat;
 import static org.mockito.Matchers.eq;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.when;
 import static org.ovirt.engine.core.utils.MockConfigRule.mockConfig;
 
 import java.util.ArrayList;
@@ -69,6 +71,7 @@
 
     @Mock
     private GlusterAuditLogUtil logUtil;
+
     @ClassRule
     public static MockConfigRule mcr = new MockConfigRule(
             mockConfig(ConfigValues.GlusterBrickProvisioningEnabled, 
Version.v3_6.toString(), true),
@@ -88,6 +91,7 @@
         doReturn(getClusters()).when(clusterDao).getAll();
         doReturn(vdsDao).when(syncJob).getVdsDao();
         
doReturn(getAllUpServers()).when(clusterUtils).getAllUpServers(CLUSTER_GUID_3_6);
+        
when(clusterUtils.isFeatureSupportedAsAdditionalFeature(any(Guid.class), 
anyString())).thenReturn(false);
         
doReturn(getStorageDevices(HOST_ID_WITH_NEW_DEVICES)).when(storageDeviceDao)
                 .getStorageDevicesInHost(HOST_ID_WITH_NEW_DEVICES);
         
doReturn(getStorageDevices(HOST_ID_WITH_DEVICES_CHANGED)).when(storageDeviceDao)
diff --git 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterFeaturesUtil.java
 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterFeaturesUtil.java
index 172789d..e1a216c 100644
--- 
a/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterFeaturesUtil.java
+++ 
b/frontend/webadmin/modules/uicommonweb/src/main/java/org/ovirt/engine/ui/uicommonweb/models/gluster/GlusterFeaturesUtil.java
@@ -21,6 +21,6 @@
     }
 
     public static boolean isGlusterBrickProvisioningSupported(Version version) 
{
-        return Version.v3_6.compareTo(version) <= 0;
+        return Version.v3_5.compareTo(version) <= 0;
     }
 }


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9074a500caa1b5a30cea19e9fa4420e12d3fa6a1
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Ramesh N <rnach...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to