cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mc...@apache.org
Subject [1/2] git commit: updated refs/heads/object_store to 2e28515
Date Mon, 06 May 2013 18:30:58 GMT
Updated Branches:
  refs/heads/object_store bc244ccc8 -> 2e2851562


Revert previous workaround for ListTemplateCommand, which is correct
after updating the systemvm.iso on devcloud.

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

Branch: refs/heads/object_store
Commit: 7ad263b67e4e0f0ed06c5cb1c99ac5a1bbd5d423
Parents: bc244cc
Author: Min Chen <min.chen@citrix.com>
Authored: Mon May 6 11:29:57 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Mon May 6 11:29:57 2013 -0700

----------------------------------------------------------------------
 .../agent/api/storage/ListTemplateCommand.java     |   12 ++++++------
 .../resource/NfsSecondaryStorageResource.java      |    2 +-
 .../com/cloud/agent/transport/RequestTest.java     |    5 ++++-
 .../storage/image/TemplateServiceImpl.java         |    2 +-
 4 files changed, 12 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad263b6/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java b/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
index 390f09b..e5339f2 100644
--- a/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
+++ b/api/src/com/cloud/agent/api/storage/ListTemplateCommand.java
@@ -20,14 +20,14 @@ import com.cloud.agent.api.to.DataStoreTO;
 
 public class ListTemplateCommand extends StorageCommand {
     private DataStoreTO store;
-    private String secUrl;
+    //private String secUrl;
 
     public ListTemplateCommand() {
     }
 
-	public ListTemplateCommand(DataStoreTO store, String url) {
+	public ListTemplateCommand(DataStoreTO store) {
         this.store = store;
-        this.secUrl = url;
+//        this.secUrl = url;
 	}
 
     @Override
@@ -40,8 +40,8 @@ public class ListTemplateCommand extends StorageCommand {
         return store;
     }
 
-    public String getSecUrl() {
-        return secUrl;
-    }
+ //   public String getSecUrl() {
+ //       return secUrl;
+ //   }
 
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad263b6/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
----------------------------------------------------------------------
diff --git a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
index 9c09faa..d9f91a3 100755
--- a/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
+++ b/core/src/com/cloud/storage/resource/NfsSecondaryStorageResource.java
@@ -1153,7 +1153,7 @@ public class NfsSecondaryStorageResource extends ServerResourceBase
implements S
         DataStoreTO store = cmd.getDataStore();
         if (store instanceof NfsTO) {
             NfsTO nfs = (NfsTO) store;
-            String secUrl = cmd.getSecUrl();
+            String secUrl = nfs.getUrl();
             String root = getRootDir(secUrl);
             Map<String, TemplateProp> templateInfos = _dlMgr.gatherTemplateInfo(root);
             return new ListTemplateAnswer(secUrl, templateInfos);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad263b6/core/test/com/cloud/agent/transport/RequestTest.java
----------------------------------------------------------------------
diff --git a/core/test/com/cloud/agent/transport/RequestTest.java b/core/test/com/cloud/agent/transport/RequestTest.java
index 27bb4ff..510be91 100644
--- a/core/test/com/cloud/agent/transport/RequestTest.java
+++ b/core/test/com/cloud/agent/transport/RequestTest.java
@@ -33,6 +33,7 @@ import com.cloud.agent.api.SecStorageFirewallCfgCommand;
 import com.cloud.agent.api.SecStorageSetupCommand;
 import com.cloud.agent.api.UpdateHostPasswordCommand;
 import com.cloud.agent.api.storage.DownloadAnswer;
+import com.cloud.agent.api.storage.ListTemplateCommand;
 import com.cloud.agent.api.to.NfsTO;
 import com.cloud.exception.UnsupportedVersionException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
@@ -135,7 +136,8 @@ public class RequestTest extends TestCase {
         s_logger.info("Testing serializing and deserializing interface TO works as expected");
 
         NfsTO nfs = new NfsTO("nfs://192.168.56.10/opt/storage/secondary", DataStoreRole.Image);
-        SecStorageSetupCommand cmd = new SecStorageSetupCommand(nfs, "nfs://192.168.56.10/opt/storage/secondary",
null);
+       // SecStorageSetupCommand cmd = new SecStorageSetupCommand(nfs, "nfs://192.168.56.10/opt/storage/secondary",
null);
+        ListTemplateCommand cmd = new ListTemplateCommand(nfs);
         Request sreq = new Request(2, 3, cmd, true);
         sreq.setSequence(892403718);
 
@@ -158,6 +160,7 @@ public class RequestTest extends TestCase {
         assert creq != null : "Couldn't get the request back";
 
         compareRequest(creq, sreq);
+        assertEquals("nfs://192.168.56.10/opt/storage/secondary", ((NfsTO)((ListTemplateCommand)creq.getCommand()).getDataStore()).getUrl());
     }
 
     public void testDownload() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/7ad263b6/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
index b7b42e5..60b3f53 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
@@ -417,7 +417,7 @@ public class TemplateServiceImpl implements TemplateService {
 
 
     private Map<String, TemplateProp> listTemplate(DataStore ssStore) {
-        ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO(), ssStore.getUri());
+        ListTemplateCommand cmd = new ListTemplateCommand(ssStore.getTO());
         EndPoint ep = _epSelector.select(ssStore);
         Answer answer = ep.sendMessage(cmd);
         if (answer != null && answer.getResult()) {


Mime
View raw message