From d6faf7b5865cf2dd109e652aa59713647db91157 Mon Sep 17 00:00:00 2001 From: Min Chen Date: Sat, 27 Jul 2013 21:48:54 -0700 Subject: [PATCH] CLOUDSTACK-3861: Remove s3.enable and swift.enable from global setting. --- server/src/com/cloud/configuration/Config.java | 2 -- server/src/com/cloud/storage/s3/S3ManagerImpl.java | 12 ++++-------- setup/db/db/schema-410to420.sql | 2 ++ 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index e800c406ce1..a1fbe883a21 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -149,8 +149,6 @@ public enum Config { // Advanced JobExpireMinutes("Advanced", ManagementServer.class, String.class, "job.expire.minutes", "1440", "Time (in minutes) for async-jobs to be kept in system", null), JobCancelThresholdMinutes("Advanced", ManagementServer.class, String.class, "job.cancel.threshold.minutes", "60", "Time (in minutes) for async-jobs to be forcely cancelled if it has been in process for long", null), - SwiftEnable("Advanced", ManagementServer.class, Boolean.class, "swift.enable", "false", "enable swift ", null), - S3Enable("Advanced", ManagementServer.class, Boolean.class, "s3.enable", "false", "enable s3 ", null), EventPurgeInterval("Advanced", ManagementServer.class, Integer.class, "event.purge.interval", "86400", "The interval (in seconds) to wait before running the event purge thread", null), AccountCleanupInterval("Advanced", ManagementServer.class, Integer.class, "account.cleanup.interval", "86400", "The interval (in seconds) between cleanup for removed accounts", null), AllowPublicUserTemplates("Advanced", ManagementServer.class, Integer.class, "allow.public.user.templates", "true", "If false, users will not be able to create public templates.", null, ConfigurationParameterScope.account.toString()), diff --git a/server/src/com/cloud/storage/s3/S3ManagerImpl.java b/server/src/com/cloud/storage/s3/S3ManagerImpl.java index f393fff6268..1f8486c88ff 100644 --- a/server/src/com/cloud/storage/s3/S3ManagerImpl.java +++ b/server/src/com/cloud/storage/s3/S3ManagerImpl.java @@ -29,7 +29,6 @@ import static com.cloud.utils.StringUtils.join; import static com.cloud.utils.db.GlobalLock.executeWithNoWaitLock; import static java.lang.Boolean.TRUE; import static java.lang.String.format; -import static java.util.Arrays.asList; import static java.util.Collections.emptyList; import static java.util.Collections.shuffle; import static java.util.Collections.singletonList; @@ -58,7 +57,6 @@ import com.cloud.agent.api.Answer; import com.cloud.agent.api.DownloadTemplateFromS3ToSecondaryStorageCommand; import com.cloud.agent.api.UploadTemplateToS3FromSecondaryStorageCommand; import com.cloud.agent.api.to.S3TO; -import com.cloud.configuration.Config; import com.cloud.configuration.dao.ConfigurationDao; import com.cloud.dc.DataCenterVO; import com.cloud.dc.dao.DataCenterDao; @@ -77,7 +75,6 @@ import com.cloud.storage.dao.VMTemplateDao; import com.cloud.storage.dao.VMTemplateHostDao; import com.cloud.storage.dao.VMTemplateS3Dao; import com.cloud.storage.dao.VMTemplateZoneDao; -import com.cloud.storage.secondary.SecondaryStorageVmManager; import com.cloud.utils.S3Utils.ClientOptions; import com.cloud.utils.component.ManagerBase; import com.cloud.utils.db.Filter; @@ -258,9 +255,9 @@ public class S3ManagerImpl extends ManagerBase implements S3Manager { params.get(ApiConstants.S3_END_POINT), params.get(ApiConstants.S3_BUCKET_NAME), params.get(ApiConstants.S3_HTTPS_FLAG) == null ? false : Boolean.valueOf(params.get(ApiConstants.S3_HTTPS_FLAG)), - params.get(ApiConstants.S3_CONNECTION_TIMEOUT) == null ? null : Integer.valueOf(params.get(ApiConstants.S3_CONNECTION_TIMEOUT)), - params.get(ApiConstants.S3_MAX_ERROR_RETRY) == null ? null : Integer.valueOf(params.get(ApiConstants.S3_MAX_ERROR_RETRY)), - params.get(ApiConstants.S3_SOCKET_TIMEOUT) == null ? null : Integer.valueOf(params.get(ApiConstants.S3_SOCKET_TIMEOUT)), now()); + params.get(ApiConstants.S3_CONNECTION_TIMEOUT) == null ? null : Integer.valueOf(params.get(ApiConstants.S3_CONNECTION_TIMEOUT)), + params.get(ApiConstants.S3_MAX_ERROR_RETRY) == null ? null : Integer.valueOf(params.get(ApiConstants.S3_MAX_ERROR_RETRY)), + params.get(ApiConstants.S3_SOCKET_TIMEOUT) == null ? null : Integer.valueOf(params.get(ApiConstants.S3_SOCKET_TIMEOUT)), now()); this.validateFields(s3VO); @@ -271,8 +268,7 @@ public class S3ManagerImpl extends ManagerBase implements S3Manager { @Override public boolean isS3Enabled() { - return Boolean - .valueOf(configurationDao.getValue(Config.S3Enable.key())); + return false; } @Override diff --git a/setup/db/db/schema-410to420.sql b/setup/db/db/schema-410to420.sql index f6d40c06a2a..26ef96401ff 100644 --- a/setup/db/db/schema-410to420.sql +++ b/setup/db/db/schema-410to420.sql @@ -35,6 +35,8 @@ UPDATE `cloud`.`hypervisor_capabilities` SET `storage_motion_supported`=true WHE UPDATE `cloud`.`hypervisor_capabilities` SET `storage_motion_supported`=true WHERE `hypervisor_type`='VMware' AND `hypervisor_version`='5.0'; DELETE FROM `cloud`.`configuration` where name='vmware.percluster.host.max'; DELETE FROM `cloud`.`configuration` where name='router.template.id'; +DELETE FROM `cloud`.`configuration` where name='swift.enable'; +DELETE FROM `cloud`.`configuration` where name='s3.enable'; INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Advanced', 'DEFAULT', 'AgentManager', 'xen.nics.max', '7', 'Maximum allowed nics for Vms created on Xen'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'midonet.apiserver.address', 'http://localhost:8081', 'Specify the address at which the Midonet API server can be contacted (if using Midonet)'); INSERT IGNORE INTO `cloud`.`configuration` VALUES ('Network', 'DEFAULT', 'management-server', 'midonet.providerrouter.id', 'd7c5e6a3-e2f4-426b-b728-b7ce6a0448e5', 'Specifies the UUID of the Midonet provider router (if using Midonet)');