cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject [1/2] git commit: updated refs/heads/object_store to fc74d76
Date Fri, 03 May 2013 16:53:59 GMT
Updated Branches:
  refs/heads/object_store c60c373a3 -> fc74d7669


download template to primary storage works now


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

Branch: refs/heads/object_store
Commit: 0c6e87c701fcf08fad2fbb62d618be339d27eeca
Parents: c60c373
Author: Edison Su <sudison@gmail.com>
Authored: Fri May 3 09:45:31 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Fri May 3 09:45:31 2013 -0700

----------------------------------------------------------------------
 .../cloudstack/storage/to/VolumeObjectTO.java      |    2 +-
 .../storage/test/CloudStackTestNGBase.java         |   14 +++++++++++-
 .../storage/test/DirectAgentManagerSimpleImpl.java |   12 +++++++++-
 .../cloudstack/storage/test/volumeServiceTest.java |   16 ---------------
 .../cloudstack/storage/volume/VolumeObject.java    |    7 +++++-
 .../storage/volume/VolumeServiceImpl.java          |    2 +-
 6 files changed, 30 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c6e87c7/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
----------------------------------------------------------------------
diff --git a/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java b/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
index 0b88469..5e6ca2b 100644
--- a/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
+++ b/engine/api/src/org/apache/cloudstack/storage/to/VolumeObjectTO.java
@@ -41,7 +41,7 @@ public class VolumeObjectTO implements DataTO {
 
     public VolumeObjectTO(VolumeInfo volume) {
         this.uuid = volume.getUuid();
-        this.path = volume.getUri();
+        this.path = volume.getPath();
         this.accountId = volume.getAccountId();
         if (volume.getDataStore() != null) {
             this.dataStore = volume.getDataStore().getTO();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c6e87c7/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
index 40267a7..4ea3d3f 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/CloudStackTestNGBase.java
@@ -36,6 +36,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
     private String localStorageUuid;
     private String primaryStorageUrl;
     private String secondaryStorage;
+    private String imageInstallPath;
     private Transaction txn;
 
     private String s3AccessKey;
@@ -66,13 +67,14 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
     }
 
     @BeforeMethod(alwaysRun = true)
+
     @Parameters({"devcloud-host-uuid", "devcloud-host-gateway", "devcloud-host-cidr",
         "devcloud-host-ip", "template-url", "devcloud-local-storage-uuid",
-        "primary-storage-want-to-add", "devcloud-secondary-storage", "s3-accesskey", "s3-secretkey",
"s3-endpoint", "s3-template-bucket", "s3-usehttps"})
+        "primary-storage-want-to-add", "devcloud-secondary-storage", "s3-accesskey", "s3-secretkey",
"s3-endpoint", "s3-template-bucket", "s3-usehttps", "image-install-path"})
     protected void setup(String hostuuid, String gateway, String cidr,
             String hostIp, String templateUrl, String localStorageUuid,
             String primaryStorage, String secondaryStorage, String s3_accessKey, String s3_secretKey,
String s3_endpoint, String s3_template_bucket,
-            String s3_usehttps) {
+            String s3_usehttps, String imageInstallPath) {
         this.hostGuid = hostuuid;
         this.hostGateway = gateway;
         this.hostCidr = cidr;
@@ -80,6 +82,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
         this.templateUrl = templateUrl;
         this.localStorageUuid = localStorageUuid;
         this.primaryStorageUrl = primaryStorage;
+        this.imageInstallPath = imageInstallPath;
         this.setSecondaryStorage(secondaryStorage);
         // set S3 parameters
         this.s3AccessKey = s3_accessKey;
@@ -125,6 +128,7 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
 		this.secondaryStorage = secondaryStorage;
 	}
 
+
     public String getS3AccessKey() {
         return s3AccessKey;
     }
@@ -145,6 +149,12 @@ public class CloudStackTestNGBase extends AbstractTestNGSpringContextTests
{
         return s3UseHttps;
     }
 
+    public String getImageInstallPath() {
+        return imageInstallPath;
+    }
 
+    public void setImageInstallPath(String imageInstallPath) {
+        this.imageInstallPath = imageInstallPath;
+    }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c6e87c7/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
index 6941ff8..127c0e3 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/DirectAgentManagerSimpleImpl.java
@@ -79,8 +79,16 @@ public class DirectAgentManagerSimpleImpl extends ManagerBase implements
AgentMa
 
     @Override
     public Answer easySend(Long hostId, Command cmd) {
-        // TODO Auto-generated method stub
-        return null;
+      try {
+        return this.send(hostId, cmd);
+    } catch (AgentUnavailableException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+    } catch (OperationTimedoutException e) {
+        // TODO Auto-generated catch block
+        e.printStackTrace();
+    }
+      return null;
     }
 
     protected void loadResource(Long hostId) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c6e87c7/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
----------------------------------------------------------------------
diff --git a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
index 919ca35..2152b2e 100644
--- a/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
+++ b/engine/storage/integration-test/test/org/apache/cloudstack/storage/test/volumeServiceTest.java
@@ -183,22 +183,6 @@ public class volumeServiceTest extends CloudStackTestNGBase {
 		imageStore.setUuid(UUID.randomUUID().toString());
 		imageStore = imageStoreDao.persist(imageStore);
 
-		//primaryStore = createPrimaryDataStore();
-
-		//CreateVolumeAnswer createVolumeFromImageAnswer = new CreateVolumeAnswer(UUID.randomUUID().toString());
-
-		/*try {
-			Mockito.when(agentMgr.send(Mockito.anyLong(), Mockito.any(CreateVolumeFromBaseImageCommand.class))).thenReturn(createVolumeFromImageAnswer);
-		} catch (AgentUnavailableException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		} catch (OperationTimedoutException e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-		}*/
-
-
-		//Mockito.when(primaryStoreDao.findById(Mockito.anyLong())).thenReturn(primaryStore);
 	}
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c6e87c7/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
index 31a2e6f..d1d7b8d 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeObject.java
@@ -244,7 +244,12 @@ public class VolumeObject implements VolumeInfo {
 
     @Override
     public String getPath() {
-        return this.volumeVO.getPath();
+        if (this.dataStore.getRole() == DataStoreRole.Primary) {
+            return this.volumeVO.getPath();
+        } else {
+            DataObjectInStore objInStore = this.ojbectInStoreMgr.findObject(this, dataStore);
+            return objInStore.getInstallPath();
+        }
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0c6e87c7/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
index 2159733..07a5430 100644
--- a/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
+++ b/engine/storage/volume/src/org/apache/cloudstack/storage/volume/VolumeServiceImpl.java
@@ -376,7 +376,7 @@ public class VolumeServiceImpl implements VolumeService {
             templateOnPrimaryStoreObj.processEvent(Event.OperationFailed);
             VolumeApiResult result = new VolumeApiResult(volume);
             result.setResult(e.toString());
-            caller.complete(result);
+            future.complete(result);
         }
         return;
     }


Mime
View raw message