From c6e226da74e53259c632bce687b12ce05f8408ca Mon Sep 17 00:00:00 2001 From: Chiradeep Vittal Date: Mon, 8 Apr 2013 17:29:54 -0700 Subject: [PATCH] CLOUDSTACK-524: in some cases (especially the built-in CentOS template), the template downloader does not use the configured http proxy The DownloadProgress command is used to restart failed or stuck download jobs -- and it would not include the proxy information, unlike the DownloadCommand which always did Signed-off-by: Chiradeep Vittal --- .../src/com/cloud/storage/download/DownloadMonitorImpl.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java index ee8df745fc7..cfb92d5ccde 100755 --- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java +++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java @@ -363,10 +363,10 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor start(); DownloadCommand dcmd = new DownloadCommand(secUrl, template, maxTemplateSizeInBytes); - dcmd.setProxy(getHttpProxy()); if (downloadJobExists) { dcmd = new DownloadProgressCommand(dcmd, vmTemplateHost.getJobId(), RequestType.GET_OR_RESTART); } + dcmd.setProxy(getHttpProxy()); if (vmTemplateHost.isCopy()) { dcmd.setCreds(TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd); } @@ -452,12 +452,11 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor if(volumeHost != null) { start(); DownloadCommand dcmd = new DownloadCommand(secUrl, volume, maxVolumeSizeInBytes, checkSum, url, format); - dcmd.setProxy(getHttpProxy()); if (downloadJobExists) { dcmd = new DownloadProgressCommand(dcmd, volumeHost.getJobId(), RequestType.GET_OR_RESTART); dcmd.setResourceType(ResourceType.VOLUME); } - + dcmd.setProxy(getHttpProxy()); HostVO ssvm = _ssvmMgr.pickSsvmHost(sserver); if( ssvm == null ) { s_logger.warn("There is no secondary storage VM for secondary storage host " + sserver.getName());