Ravi Nori has uploaded a new change for review.

Change subject: tools: engine-config cleanup 2.2 IsNeedSupportForOldVgAPI
......................................................................

tools: engine-config cleanup 2.2 IsNeedSupportForOldVgAPI

Remove deprecated config values for version 2.2 from engine-config

Removed IsNeedSupportForOldVgAPI key and the code surrounding this key

Change-Id: I373eb6607744b44069ee59adaae1625fc6f676c9
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=859045
Signed-off-by: Ravi Nori <rn...@redhat.com>
---
M backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommand.java
M 
backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
M 
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
4 files changed, 3 insertions(+), 33 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/85/9485/1

diff --git a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql 
b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
index 3331e88..0121a4e 100644
--- a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
+++ b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql
@@ -229,8 +229,6 @@
 
 
 select fn_db_add_config_value('IsMultilevelAdministrationOn','true','general');
-select fn_db_add_config_value('IsNeedSupportForOldVgAPI','true','2.2');
-select fn_db_add_config_value('IsNeedSupportForOldVgAPI','false','3.0');
 select fn_db_add_config_value('JobCleanupRateInMinutes','10','general');
 select fn_db_add_config_value('JobPageSize','100','general');
 select fn_db_add_config_value('keystorePass','NoSoup4U','general');
@@ -662,6 +660,8 @@
 select fn_db_delete_config_value('VdsErrorsFileName','general');
 select fn_db_delete_config_value('VM64BitMaxMemorySizeInMB','general');
 select fn_db_delete_config_value('LogVdsRegistration','general');
+select fn_db_delete_config_value('IsNeedSupportForOldVgAPI','2.2');
+select fn_db_delete_config_value('IsNeedSupportForOldVgAPI','3.0');
 
------------------------------------------------------------------------------------
 --                  Split config section
 -- The purpose of this section is to treat config option that was once
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommand.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommand.java
index 858751d..63e5d8e 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommand.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainCommand.java
@@ -2,7 +2,6 @@
 
 import java.util.Collections;
 import java.util.Map;
-
 import org.ovirt.engine.core.bll.LockIdNameAttribute;
 import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
 import org.ovirt.engine.core.common.AuditLogType;
@@ -14,12 +13,9 @@
 import org.ovirt.engine.core.common.businessentities.StorageType;
 import org.ovirt.engine.core.common.businessentities.VDS;
 import org.ovirt.engine.core.common.businessentities.storage_domains;
-import org.ovirt.engine.core.common.config.Config;
-import org.ovirt.engine.core.common.config.ConfigValues;
 import org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend;
 import org.ovirt.engine.core.common.locks.LockingGroup;
 import 
org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters;
-import org.ovirt.engine.core.common.vdscommands.RemoveVGVDSCommandParameters;
 import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
 import org.ovirt.engine.core.compat.Guid;
 import org.ovirt.engine.core.dal.VdcBllMessages;
@@ -50,7 +46,7 @@
                 return;
             }
 
-            boolean failed = !formatStorage(dom, vds) || !removeStorage(dom, 
vds);
+            boolean failed = !formatStorage(dom, vds);
 
             DisconnectStorage();
 
@@ -192,17 +188,6 @@
         return getVdsBroker()
                 .RunVdsCommand(VDSCommandType.FormatStorageDomain,
                         new 
FormatStorageDomainVDSCommandParameters(vds.getId(), 
dom.getId())).getSucceeded();
-    }
-
-    @SuppressWarnings("deprecation")
-    protected boolean removeStorage(storage_domains dom, VDS vds) {
-        if (Config.<Boolean> GetValue(ConfigValues.IsNeedSupportForOldVgAPI,
-                vds.getvds_group_compatibility_version().getValue()) && 
(isFCP(dom) || isISCSI(dom))) {
-            return getVdsBroker()
-                    .RunVdsCommand(VDSCommandType.RemoveVG,
-                            new RemoveVGVDSCommandParameters(vds.getId(), 
dom.getstorage())).getSucceeded();
-        }
-        return true;
     }
 
     @Override
diff --git 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
index 067c80b..1834dd8 100644
--- 
a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
+++ 
b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/RemoveStorageDomainTest.java
@@ -31,7 +31,6 @@
 import org.ovirt.engine.core.common.businessentities.storage_domains;
 import org.ovirt.engine.core.common.businessentities.storage_pool;
 import org.ovirt.engine.core.common.businessentities.storage_pool_iso_map;
-import org.ovirt.engine.core.common.config.ConfigValues;
 import org.ovirt.engine.core.common.interfaces.VDSBrokerFrontend;
 import 
org.ovirt.engine.core.common.vdscommands.FormatStorageDomainVDSCommandParameters;
 import org.ovirt.engine.core.common.vdscommands.RemoveVGVDSCommandParameters;
@@ -48,20 +47,11 @@
 import org.ovirt.engine.core.dao.StoragePoolDAO;
 import org.ovirt.engine.core.dao.StoragePoolIsoMapDAO;
 import org.ovirt.engine.core.dao.VdsDAO;
-import org.ovirt.engine.core.utils.MockConfigRule;
 import org.ovirt.engine.core.utils.MockEJBStrategyRule;
 
 @RunWith(MockitoJUnitRunner.class)
 public class RemoveStorageDomainTest {
     private static final Version VDS_COMPATIBILITY_VERSION = new Version(2, 2);
-
-    @Rule
-    public static MockConfigRule mcr =
-            new MockConfigRule(
-                    
MockConfigRule.mockConfig(ConfigValues.IsNeedSupportForOldVgAPI,
-                            VDS_COMPATIBILITY_VERSION.getValue(),
-                            true)
-            );
 
     @Rule
     public MockEJBStrategyRule mockEjbRule = new MockEJBStrategyRule();
diff --git 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
index 6a46b74..74588e1 100644
--- 
a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
+++ 
b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java
@@ -1177,11 +1177,6 @@
     DefaultMaxThreadPoolSize(324),
 
     @Reloadable
-    @TypeConverterAttribute(Boolean.class)
-    @DefaultValueAttribute("false")
-    IsNeedSupportForOldVgAPI(325),
-
-    @Reloadable
     @TypeConverterAttribute(Integer.class)
     @DefaultValueAttribute("1")
     InitStorageSparseSizeInGB(326),


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

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

Reply via email to