cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [2/2] git commit: updated refs/heads/4.2 to 9f9f7d3
Date Mon, 22 Jul 2013 23:15:59 GMT
CLOUDSTACK-3513:[Automation] Failed to copy iso and template between
zones. Failed to pass generated copy url to DownloadCommand.


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

Branch: refs/heads/4.2
Commit: 5ccfc9df5a21a7e03222d45c2a386700ed8f0456
Parents: c2faa09
Author: Min Chen <min.chen@citrix.com>
Authored: Mon Jul 22 16:09:57 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Mon Jul 22 16:15:45 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/storage/image/TemplateDataFactoryImpl.java   | 9 ++++++++-
 .../src/com/cloud/storage/download/DownloadMonitorImpl.java | 9 +++++++++
 2 files changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ccfc9df/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
index 1db49ae..a67f08f 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateDataFactoryImpl.java
@@ -104,6 +104,13 @@ public class TemplateDataFactoryImpl implements TemplateDataFactory {
 
     @Override
     public TemplateInfo getTemplate(DataObject obj, DataStore store) {
-        return this.getTemplate(obj.getId(), store);
+        TemplateObject tmpObj = (TemplateObject) this.getTemplate(obj.getId(), store);
+        // carry over url set in passed in data object, for copyTemplate case
+        // where url is generated on demand and not persisted in DB.
+        // need to think of a more generic way to pass these runtime information
+        // carried through DataObject post 4.2
+        TemplateObject origTmpl = (TemplateObject) obj;
+        tmpObj.setUrl(origTmpl.getUrl());
+        return tmpObj;
     }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5ccfc9df/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 4918bf5..f055085 100755
--- a/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
+++ b/server/src/com/cloud/storage/download/DownloadMonitorImpl.java
@@ -55,6 +55,7 @@ import com.cloud.agent.api.storage.Proxy;
 import com.cloud.configuration.Config;
 import com.cloud.configuration.dao.ConfigurationDao;
 import com.cloud.storage.RegisterVolumePayload;
+import com.cloud.storage.VMTemplateStorageResourceAssoc;
 import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.VMTemplateStorageResourceAssoc.Status;
 import com.cloud.storage.Volume;
@@ -215,7 +216,15 @@ public class DownloadMonitorImpl extends ManagerBase implements DownloadMonitor
         if (isTemplateUpdateable(templateId, store.getId())) {
             if (template != null && template.getUri() != null) {
                 initiateTemplateDownload(template, callback);
+            } else {
+                s_logger.info("Template url is null, cannot download");
+                DownloadAnswer ans = new DownloadAnswer("Template url is null", VMTemplateStorageResourceAssoc.Status.DOWNLOAD_ERROR.UNKNOWN);
+                callback.complete(ans);
             }
+        } else {
+            s_logger.info("Template download is already in progress or already downloaded");
+            DownloadAnswer ans = new DownloadAnswer("Template download is already in progress
or already downloaded", VMTemplateStorageResourceAssoc.Status.DOWNLOAD_ERROR.UNKNOWN);
+            callback.complete(ans);
         }
     }
 


Mime
View raw message