bug 7519 : Some additional code.

This commit is contained in:
nit 2011-01-12 19:35:28 +05:30
parent dce1e2031b
commit d5297519a5
3 changed files with 9 additions and 3 deletions

View File

@ -330,8 +330,8 @@ public class UploadMonitorImpl implements UploadMonitor {
}
_agentMgr.registerForHostEvents(new UploadListener(this), true, false, false);
String cleanupInterval = (String)params.get("extract.url.cleanup.interval");
_cleanupInterval = NumbersUtil.parseInt(cleanupInterval, 21600);
String cleanupInterval = configs.get("extract.url.cleanup.interval");
_cleanupInterval = NumbersUtil.parseInt(cleanupInterval, 14400);
String workers = (String)params.get("expunge.workers");
@ -469,7 +469,7 @@ public class UploadMonitorImpl implements UploadMonitor {
public void cleanupStorage() {
final int EXTRACT_URL_LIFE_LIMIT_IN_SECONDS = 86400;//FIX ME make it configurable.
final int EXTRACT_URL_LIFE_LIMIT_IN_SECONDS = 14400;//FIX ME make it configurable.
List<UploadVO> extractJobs= _uploadDao.listByModeAndStatus(Mode.HTTP_DOWNLOAD, Status.DOWNLOAD_URL_CREATED);
for (UploadVO extractJob : extractJobs){

View File

@ -501,6 +501,9 @@ public class TemplateManagerImpl implements TemplateManager, Manager, TemplateSe
if (template.getTemplateType() == Storage.TemplateType.SYSTEM){
throw new InvalidParameterValueException("Unable to extract the " + desc + " " + template.getName() + " as it is a default System template");
}
if (template.getTemplateType() == Storage.TemplateType.PERHOST){
throw new InvalidParameterValueException("Unable to extract the " + desc + " " + template.getName() + " as it resides on host and not on SSVM");
}
if (isISO) {
if (template.getFormat() != ImageFormat.ISO ){
throw new InvalidParameterValueException("Unsupported format, could not extract the ISO");

3
server/src/com/cloud/test/DatabaseConfig.java Normal file → Executable file
View File

@ -52,6 +52,7 @@ import org.xml.sax.helpers.DefaultHandler;
import com.cloud.host.Status;
import com.cloud.network.Network;
import com.cloud.server.ManagementServer;
import com.cloud.service.ServiceOfferingVO;
import com.cloud.service.dao.ServiceOfferingDaoImpl;
import com.cloud.storage.DiskOfferingVO;
@ -269,6 +270,7 @@ public class DatabaseConfig {
s_configurationComponents.put("consoleproxy.session.max", "AgentManager");
s_configurationComponents.put("consoleproxy.session.timeout", "AgentManager");
s_configurationComponents.put("expunge.workers", "UserVmManager");
s_configurationComponents.put("extract.url.cleanup.interval", "management-server");
s_configurationComponents.put("stop.retry.interval", "HighAvailabilityManager");
s_configurationComponents.put("restart.retry.interval", "HighAvailabilityManager");
s_configurationComponents.put("investigate.retry.interval", "HighAvailabilityManager");
@ -325,6 +327,7 @@ public class DatabaseConfig {
s_defaultConfigurationValues.put("max.account.user.vms", "20");
s_defaultConfigurationValues.put("max.account.public.ips", "20");
s_defaultConfigurationValues.put("expunge.interval", "86400");
s_defaultConfigurationValues.put("extract.url.cleanup.interval", "120");
s_defaultConfigurationValues.put("instance.name", "VM");
s_defaultConfigurationValues.put("expunge.workers", "1");
s_defaultConfigurationValues.put("stop.retry.interval", "600");