Ravi Nori has uploaded a new change for review. Change subject: tools: engine-config cleanup 2.2 LocalStorageEnabled ......................................................................
tools: engine-config cleanup 2.2 LocalStorageEnabled Remove deprecated config values for version 2.2 from engine-config Removed LocalStorageEnabled key and the boolean logic corresponding to it. Also removed the unused messages from property files. Change-Id: Ic57700ab264e46dba0704dfdbedbbc7c7ff92c3b Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=859045 Signed-off-by: Ravi Nori <[email protected]> --- M backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddEmptyStoragePoolCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StoragePoolValidator.java M backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/config/ConfigValues.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java M backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResourceTest.java M backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilityResourceTest.java M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java 11 files changed, 4 insertions(+), 79 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/87/9487/1 diff --git a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql index 1218493..71f43c6 100644 --- a/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql +++ b/backend/manager/dbscripts/upgrade/pre_upgrade/0000_config.sql @@ -255,10 +255,6 @@ select fn_db_add_config_value('LiveStorageMigrationEnabled','false','3.1'); select fn_db_add_config_value('LiveStorageMigrationEnabled','true','3.2'); select fn_db_add_config_value('LocalAdminPassword','123456','general'); -select fn_db_add_config_value('LocalStorageEnabled','false','2.2'); -select fn_db_add_config_value('LocalStorageEnabled','true','3.0'); -select fn_db_add_config_value('LocalStorageEnabled','true','3.1'); -select fn_db_add_config_value('LocalStorageEnabled','true','3.2'); --Handling Enable lock policy for Storage Pool Manager on activation select fn_db_add_config_value('LockPolicy','ON','general'); select fn_db_add_config_value('LockRenewalIntervalSec','5','general'); @@ -662,6 +658,10 @@ select fn_db_delete_config_value('LimitNumberOfNetworkInterfaces','3.0'); select fn_db_delete_config_value('LimitNumberOfNetworkInterfaces','3.1'); select fn_db_delete_config_value('LimitNumberOfNetworkInterfaces','3.2'); +select fn_db_delete_config_value('LocalStorageEnabled','2.2'); +select fn_db_delete_config_value('LocalStorageEnabled','3.0'); +select fn_db_delete_config_value('LocalStorageEnabled','3.1'); +select fn_db_delete_config_value('LocalStorageEnabled','3.2'); ------------------------------------------------------------------------------------ -- 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/AddEmptyStoragePoolCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddEmptyStoragePoolCommand.java index f56b841..88e7271 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddEmptyStoragePoolCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/AddEmptyStoragePoolCommand.java @@ -69,8 +69,6 @@ )) { addCanDoActionMessage(VersionSupport.getUnsupportedVersionMessage()); result = false; - } else if (!storagePoolValidator.isLocalDcAndMatchingCompatiblityVersion()) { - result = false; } else if (!storagePoolValidator.isPosixDcAndMatchingCompatiblityVersion()) { result = false; } diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StoragePoolValidator.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StoragePoolValidator.java index 0792647..dc3a366 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StoragePoolValidator.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/StoragePoolValidator.java @@ -51,23 +51,6 @@ return DbFacade.getInstance().getVdsGroupDao(); } - /** - * Checks in case the DC is of local type that the compatibility version matches. In case there is mismatch, a - * proper canDoAction message will be added - * - * @return true if the version matches - */ - public boolean isLocalDcAndMatchingCompatiblityVersion() { - if (storagePool.getstorage_pool_type() == StorageType.LOCALFS - && !this.<Boolean> getConfigValue(ConfigValues.LocalStorageEnabled, - storagePool.getcompatibility_version() - .toString())) { - canDoActionMessages.add(VdcBllMessages.DATA_CENTER_LOCAL_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION.toString()); - return false; - } - return true; - } - public boolean isNotLocalfsWithDefaultCluster() { if (storagePool.getstorage_pool_type() == StorageType.LOCALFS && containsDefaultCluster()) { canDoActionMessages.add(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_WITH_DEFAULT_VDS_GROUP_CANNOT_BE_LOCALFS.toString()); diff --git a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java index ab6bc2b..c868faf 100644 --- a/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java +++ b/backend/manager/modules/bll/src/test/java/org/ovirt/engine/core/bll/storage/StoragePoolValidatorTest.java @@ -32,8 +32,6 @@ StoragePoolStatus.Up.getValue()); validator = spy(new StoragePoolValidator(storagePool, new ArrayList<String>())); mockPosixStorageEnabledConfigValue(); - mockLocalStorageEnabledConfigValue(); - } protected void mockPosixStorageEnabledConfigValue() { @@ -41,13 +39,6 @@ doReturn(false).when(validator).getConfigValue(ConfigValues.PosixStorageEnabled, Version.v3_0.toString()); doReturn(false).when(validator).getConfigValue(ConfigValues.PosixStorageEnabled, Version.v2_2.toString()); doReturn(false).when(validator).getConfigValue(ConfigValues.PosixStorageEnabled, "general"); - } - - protected void mockLocalStorageEnabledConfigValue() { - doReturn(true).when(validator).getConfigValue(ConfigValues.LocalStorageEnabled, Version.v3_1.toString()); - doReturn(true).when(validator).getConfigValue(ConfigValues.LocalStorageEnabled, Version.v3_0.toString()); - doReturn(false).when(validator).getConfigValue(ConfigValues.LocalStorageEnabled, Version.v2_2.toString()); - doReturn(false).when(validator).getConfigValue(ConfigValues.LocalStorageEnabled, "general"); } @Test @@ -70,14 +61,6 @@ storagePool.setcompatibility_version(Version.v3_0); storagePool.setstorage_pool_type(StorageType.LOCALFS); assertTrue(validator.isPosixDcAndMatchingCompatiblityVersion()); - } - - @Test - public void testLocalDcAndNotMatchingCompatiblityVersion() { - storagePool.setcompatibility_version(Version.v2_2); - storagePool.setstorage_pool_type(StorageType.LOCALFS); - assertFalse(validator.isLocalDcAndMatchingCompatiblityVersion()); - assertMessages(VdcBllMessages.DATA_CENTER_LOCAL_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION); } @Test 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 116d7a7..c0843cc 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 @@ -904,11 +904,6 @@ @DefaultValueAttribute("false") SupportCustomProperties(289), - @Reloadable - @TypeConverterAttribute(Boolean.class) - @DefaultValueAttribute("false") - LocalStorageEnabled(270), - @TypeConverterAttribute(String.class) @DefaultValueAttribute("default:GSSAPI") LDAPSecurityAuthentication(271), diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java index a8aa28e..01ed144 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/queries/ConfigurationValues.java @@ -56,7 +56,6 @@ StoragePoolNameSizeLimit(ConfigAuthType.User), SANWipeAfterDelete(ConfigAuthType.User), AuthenticationMethod(ConfigAuthType.User), - LocalStorageEnabled, UserDefinedVMProperties(ConfigAuthType.User), PredefinedVMProperties(ConfigAuthType.User), SupportCustomProperties(ConfigAuthType.User), diff --git a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java index d7ddfcd..1011105 100644 --- a/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java +++ b/backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dal/VdcBllMessages.java @@ -534,7 +534,6 @@ VDS_GROUP_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE, VDS_GROUP_SELECTION_ALGORITHM_MUST_BE_SET_TO_NONE_ON_LOCAL_STORAGE, VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE, - DATA_CENTER_LOCAL_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION, DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION, VDS_GROUP_CPU_UTILIZATION_MUST_BE_IN_VALID_RANGE, diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index 7acc919..2e0b702 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -527,7 +527,6 @@ VDS_GROUP_CANNOT_ADD_MORE_THEN_ONE_HOST_TO_LOCAL_STORAGE=Cannot add more than one Cluster to "Local Storage" Data Center VDS_GROUP_SELECTION_ALGORITHM_MUST_BE_SET_TO_NONE_ON_LOCAL_STORAGE=Selection algorithm must be set to "None" on "Local Storage" Data Center VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE="Local Storage" data domain cannot be detached from Data Center -DATA_CENTER_LOCAL_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION="Local Storage" is not supported with Data Center computability version DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION="File based storage" is not supported with data center compatibility version. VDS_CANNOT_UPDATE_CLUSTER=Updating Host's Cluster cannot be performed through update Host action, please use Change Host Cluster action instead. VM_CANNOT_UPDATE_CLUSTER=Updating VM's Cluster cannot be performed through update VM action, please use Change VM Cluster action instead. diff --git a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResourceTest.java b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResourceTest.java index f3218e3..1ecea45 100644 --- a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResourceTest.java +++ b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilitiesResourceTest.java @@ -125,20 +125,6 @@ new Object[] { "10.3", ConfigurationValues.VdsFenceOptionTypes }, "one=int,two=bool"); - //expect(Config.GetValue(ConfigValues.LocalStorageEnabled, "1.5")).andReturn(Boolean.FALSE); - setUpGetEntityExpectations(VdcQueryType.GetConfigurationValue, - GetConfigurationValueParameters.class, - new String[] { "Version", "ConfigValue" }, - new Object[] { "1.5", ConfigurationValues.LocalStorageEnabled }, - Boolean.FALSE); - - //expect(Config.GetValue(ConfigValues.LocalStorageEnabled, "10.3")).andReturn(Boolean.TRUE); - setUpGetEntityExpectations(VdcQueryType.GetConfigurationValue, - GetConfigurationValueParameters.class, - new String[] { "Version", "ConfigValue" }, - new Object[] { "10.3", ConfigurationValues.LocalStorageEnabled }, - Boolean.TRUE); - //expect(Config.GetValue(ConfigValues.PredefinedVMProperties, "1.5")).andReturn(""); setUpGetEntityExpectations(VdcQueryType.GetConfigurationValue, GetConfigurationValueParameters.class, diff --git a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilityResourceTest.java b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilityResourceTest.java index ca96472..2c12e7a 100644 --- a/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilityResourceTest.java +++ b/backend/manager/modules/restapi/jaxrs/src/test/java/org/ovirt/engine/api/restapi/resource/BackendCapabilityResourceTest.java @@ -128,20 +128,6 @@ new Object[] { "10.3", ConfigurationValues.VdsFenceOptionTypes }, "one=int,two=bool"); - //expect(Config.GetValue(ConfigValues.LocalStorageEnabled, "1.5")).andReturn(Boolean.FALSE); - setUpGetEntityExpectations(VdcQueryType.GetConfigurationValue, - GetConfigurationValueParameters.class, - new String[] { "Version", "ConfigValue" }, - new Object[] { "1.5", ConfigurationValues.LocalStorageEnabled }, - Boolean.FALSE); - - //expect(Config.GetValue(ConfigValues.LocalStorageEnabled, "10.3")).andReturn(Boolean.TRUE); - setUpGetEntityExpectations(VdcQueryType.GetConfigurationValue, - GetConfigurationValueParameters.class, - new String[] { "Version", "ConfigValue" }, - new Object[] { "10.3", ConfigurationValues.LocalStorageEnabled }, - Boolean.TRUE); - //expect(Config.GetValue(ConfigValues.PredefinedVMProperties, "1.5")).andReturn(""); setUpGetEntityExpectations(VdcQueryType.GetConfigurationValue, GetConfigurationValueParameters.class, diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index 5614f07..6be5fbf 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -1402,9 +1402,6 @@ @DefaultStringValue("\"Local Storage\" data domain cannot be detached from Data Center") String VDS_GROUP_CANNOT_DETACH_DATA_DOMAIN_FROM_LOCAL_STORAGE(); - @DefaultStringValue("\"Local Storage\" is not supported with Data Center computability version") - String DATA_CENTER_LOCAL_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION(); - @DefaultStringValue("\"File based storage\" is not supported with data center compatibility version.") String DATA_CENTER_POSIX_STORAGE_NOT_SUPPORTED_IN_CURRENT_VERSION(); -- To view, visit http://gerrit.ovirt.org/9487 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic57700ab264e46dba0704dfdbedbbc7c7ff92c3b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Ravi Nori <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
