cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject git commit: updated refs/heads/object_store to 3b45bc9
Date Wed, 08 May 2013 18:13:09 GMT
Updated Branches:
  refs/heads/object_store f8edb5549 -> 3b45bc9c3


Make S3 register template work.

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

Branch: refs/heads/object_store
Commit: 3b45bc9c3060d9aa0447fff4d1f71fee304d5533
Parents: f8edb55
Author: Min Chen <min.chen@citrix.com>
Authored: Wed May 8 11:12:26 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Wed May 8 11:12:26 2013 -0700

----------------------------------------------------------------------
 core/src/com/cloud/storage/VMTemplateVO.java       |    5 +++++
 .../storage/template/DownloadManagerImpl.java      |    3 +++
 .../storage/template/S3TemplateDownloader.java     |    4 ++--
 .../cloudstack/storage/test/S3TemplateTest.java    |    5 +++++
 .../integration-test/test/resource/testng.xml      |    2 +-
 5 files changed, 16 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3b45bc9c/core/src/com/cloud/storage/VMTemplateVO.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/VMTemplateVO.java b/core/src/com/cloud/storage/VMTemplateVO.java
index e3339fd..06cb1b8 100755
--- a/core/src/com/cloud/storage/VMTemplateVO.java
+++ b/core/src/com/cloud/storage/VMTemplateVO.java
@@ -421,6 +421,11 @@ public class VMTemplateVO implements VirtualMachineTemplate, StateObject<Templat
         return -1;
     }
 
+
+    public void setAccountId(long accountId) {
+        this.accountId = accountId;
+    }
+
     @Override
     public String getUuid() {
     	return this.uuid;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3b45bc9c/core/src/com/cloud/storage/template/DownloadManagerImpl.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/DownloadManagerImpl.java b/core/src/com/cloud/storage/template/DownloadManagerImpl.java
index 7a69dab..7aea5ba 100755
--- a/core/src/com/cloud/storage/template/DownloadManagerImpl.java
+++ b/core/src/com/cloud/storage/template/DownloadManagerImpl.java
@@ -286,6 +286,9 @@ public class DownloadManagerImpl extends ManagerBase implements DownloadManager
                     td.setStatus(Status.POST_DOWNLOAD_FINISHED);
                     td.setDownloadError("Install completed successfully at " + new SimpleDateFormat().format(new
Date()));
                 }
+            } else{
+                // for s3 and swift, we skip post download step and just set status to trigger
callback.
+                td.setStatus(Status.POST_DOWNLOAD_FINISHED);
             }
             dj.cleanup();
             break;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3b45bc9c/core/src/com/cloud/storage/template/S3TemplateDownloader.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/template/S3TemplateDownloader.java b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
index bc0b904..b555ec2 100644
--- a/core/src/com/cloud/storage/template/S3TemplateDownloader.java
+++ b/core/src/com/cloud/storage/template/S3TemplateDownloader.java
@@ -170,8 +170,8 @@ public class S3TemplateDownloader implements TemplateDownloader {
 				throw new IllegalArgumentException("Unsupported scheme for url");
 			}
 			int port = uri.getPort();
-			if (!(port == 80 || port == 443 || port == -1)) {
-				throw new IllegalArgumentException("Only ports 80 and 443 are allowed");
+			if (!(port == 80 || port == 8080 || port == 443 || port == -1)) {
+				throw new IllegalArgumentException("Only ports 80, 8080 and 443 are allowed");
 			}
 
 			if (port == -1 && uri.getScheme().equalsIgnoreCase("https")) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3b45bc9c/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/S3TemplateTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/S3TemplateTest.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/S3TemplateTest.java
index 9b9f03d..5f29fde 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/S3TemplateTest.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/S3TemplateTest.java
@@ -1,5 +1,6 @@
 package org.apache.cloudstack.storage.test;
 
+import java.util.Date;
 import java.util.HashMap;
 import java.util.Map;
 import java.util.UUID;
@@ -30,10 +31,12 @@ import static org.testng.Assert.assertTrue;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.DataCenter.NetworkType;
 import com.cloud.dc.dao.DataCenterDao;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.ScopeType;
 import com.cloud.storage.Storage;
 import com.cloud.storage.VMTemplateVO;
+import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.Storage.TemplateType;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.download.DownloadMonitorImpl;
@@ -89,6 +92,7 @@ public class S3TemplateTest extends CloudStackTestNGBase {
         sDetails.put(ApiConstants.S3_END_POINT, this.getS3EndPoint());
         this.imageStoreHelper.createImageStore(sParams, sDetails);
 
+
 		VMTemplateVO image = new VMTemplateVO();
 		image.setTemplateType(TemplateType.SYSTEM);
 		image.setUrl(this.getTemplateUrl());
@@ -106,6 +110,7 @@ public class S3TemplateTest extends CloudStackTestNGBase {
 		image.setPrepopulate(true);
 		image.setCrossZones(true);
 		image.setExtractable(true);
+		image.setAccountId(2);
 		image = templateDao.persist(image);
 		templateId = image.getId();
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3b45bc9c/engine/storage/integration-test/test/resource/testng.xml
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/resource/testng.xml b/engine/storage/integration-test/test/resource/testng.xml
index a6dc392..fb43309 100644
--- a/engine/storage/integration-test/test/resource/testng.xml
+++ b/engine/storage/integration-test/test/resource/testng.xml
@@ -35,7 +35,7 @@
   <parameter name="s3-accesskey" value="OYAZXCAFUC1DAFOXNJWI"/>
   <parameter name="s3-secretkey" value="YHpRtzNDwl12DtrQmwRvdpnf2xK2AeVM30rXxQ=="/>
   <parameter name="s3-endpoint"  value="10.223.89.7:8080" />
-  <parameter name="s3-template-bucket" value="cstemplates"/>
+  <parameter name="s3-template-bucket" value="cloudstack"/>
   <parameter name="s3-usehttps"  value="false" />
 
   <parameter name="image-install-path" value="template/tmpl/1/5/"/>


Mime
View raw message