Updated Branches:
  refs/heads/master 3cbbe2bb0 -> 67a99cbbc

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 --
It would not include the proxy information, unlike the DownloadCommand which 
always did

Signed-off-by: Chiradeep Vittal <chirad...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/67a99cbb
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/67a99cbb
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/67a99cbb

Branch: refs/heads/master
Commit: 67a99cbbc3f0c415a7a6179e395e7a8b5655f6f0
Parents: 3cbbe2b
Author: Chiradeep Vittal <chirad...@apache.org>
Authored: Mon Apr 8 17:07:14 2013 -0700
Committer: Chiradeep Vittal <chirad...@apache.org>
Committed: Mon Apr 8 17:07:35 2013 -0700

----------------------------------------------------------------------
 .../storage/download/DownloadMonitorImpl.java      |   12 +++---------
 1 files changed, 3 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/67a99cbb/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java 
b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
index 7ed6f3f..ee8df74 100755
--- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
+++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
@@ -37,21 +37,17 @@ import com.cloud.agent.AgentManager;
 import com.cloud.agent.Listener;
 import com.cloud.agent.api.Answer;
 import com.cloud.agent.api.Command;
-
 import com.cloud.agent.api.storage.DeleteTemplateCommand;
 import com.cloud.agent.api.storage.DeleteVolumeCommand;
 import com.cloud.agent.api.storage.DownloadCommand;
-
 import com.cloud.agent.api.storage.DownloadCommand.Proxy;
 import com.cloud.agent.api.storage.DownloadCommand.ResourceType;
-import com.cloud.agent.api.storage.DownloadProgressCommand.RequestType;
-
 import com.cloud.agent.api.storage.DownloadProgressCommand;
+import com.cloud.agent.api.storage.DownloadProgressCommand.RequestType;
 import com.cloud.agent.api.storage.ListTemplateAnswer;
 import com.cloud.agent.api.storage.ListTemplateCommand;
 import com.cloud.agent.api.storage.ListVolumeAnswer;
 import com.cloud.agent.api.storage.ListVolumeCommand;
-
 import com.cloud.agent.manager.Commands;
 import com.cloud.alert.AlertManager;
 import com.cloud.configuration.Config;
@@ -72,13 +68,12 @@ import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.resource.ResourceManager;
 import com.cloud.storage.Storage.ImageFormat;
-
 import com.cloud.storage.StorageManager;
 import com.cloud.storage.SwiftVO;
 import com.cloud.storage.VMTemplateHostVO;
 import com.cloud.storage.VMTemplateStorageResourceAssoc;
-import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
+import com.cloud.storage.VMTemplateVO;
 import com.cloud.storage.VMTemplateZoneVO;
 import com.cloud.storage.VolumeHostVO;
 import com.cloud.storage.VolumeVO;
@@ -91,7 +86,6 @@ import com.cloud.storage.dao.VMTemplateSwiftDao;
 import com.cloud.storage.dao.VMTemplateZoneDao;
 import com.cloud.storage.dao.VolumeDao;
 import com.cloud.storage.dao.VolumeHostDao;
-
 import com.cloud.storage.secondary.SecondaryStorageVmManager;
 import com.cloud.storage.swift.SwiftManager;
 import com.cloud.storage.template.TemplateConstants;
@@ -284,10 +278,10 @@ public class DownloadMonitorImpl extends ManagerBase 
implements  DownloadMonitor
             String sourceChecksum = 
this.templateMgr.getChecksum(srcTmpltHost.getHostId(), 
srcTmpltHost.getInstallPath());
                        DownloadCommand dcmd =  
               new DownloadCommand(destServer.getStorageUrl(), url, template, 
TemplateConstants.DEFAULT_HTTP_AUTH_USER, _copyAuthPasswd, 
maxTemplateSizeInBytes); 
-                       dcmd.setProxy(getHttpProxy());
                        if (downloadJobExists) {
                                dcmd = new DownloadProgressCommand(dcmd, 
destTmpltHost.getJobId(), RequestType.GET_OR_RESTART);
                        }
+            dcmd.setProxy(getHttpProxy());
                        dcmd.setChecksum(sourceChecksum); // We need to set the 
checksum as the source template might be a compressed url and have cksum for 
compressed image. Bug #10775
             HostVO ssAhost = _ssvmMgr.pickSsvmHost(destServer);
             if( ssAhost == null ) {

Reply via email to