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 66f510b
Date Fri, 26 Apr 2013 21:02:57 GMT
Updated Branches:
  refs/heads/object_store 91bfbdf1c -> 66f510bc3


Fix build error due to ListTemplateCommand change.

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

Branch: refs/heads/object_store
Commit: 66f510bc386a170cec98cae53aecf750489342c0
Parents: 91bfbdf
Author: Min Chen <min.chen@citrix.com>
Authored: Fri Apr 26 14:02:42 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Fri Apr 26 14:02:42 2013 -0700

----------------------------------------------------------------------
 .../agent/manager/MockStorageManagerImpl.java      |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/66f510bc/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
index ae7cf29..d8a3e51 100644
--- a/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
+++ b/plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java
@@ -56,6 +56,7 @@ import com.cloud.agent.api.storage.ListVolumeAnswer;
 import com.cloud.agent.api.storage.ListVolumeCommand;
 import com.cloud.agent.api.storage.PrimaryStorageDownloadAnswer;
 import com.cloud.agent.api.storage.PrimaryStorageDownloadCommand;
+import com.cloud.agent.api.to.DataStoreTO;
 import com.cloud.agent.api.to.StorageFilerTO;
 import com.cloud.agent.api.to.VolumeTO;
 import com.cloud.simulator.MockHost;
@@ -82,6 +83,7 @@ import com.cloud.vm.DiskProfile;
 import com.cloud.vm.VirtualMachine.State;
 import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
+import com.cloud.agent.api.to.NfsTO;
 
 import javax.ejb.Local;
 import javax.inject.Inject;
@@ -468,18 +470,23 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
 
     @Override
     public Answer ListTemplates(ListTemplateCommand cmd) {
+        DataStoreTO store = cmd.getDataStore();
+        if ( !(store instanceof NfsTO )){
+            return new Answer(cmd, false, "Unsupported image data store: " + store);
+        }
         Transaction txn = Transaction.open(Transaction.SIMULATOR_DB);
         MockSecStorageVO storage = null;
+        String nfsUrl = ((NfsTO)cmd.getDataStore()).getUrl();
         try {
             txn.start();
-            storage = _mockSecStorageDao.findByUrl(cmd.getSecUrl());
+            storage = _mockSecStorageDao.findByUrl(nfsUrl);
             if (storage == null) {
                 return new Answer(cmd, false, "Failed to get secondary storage");
             }
             txn.commit();
         } catch (Exception ex) {
             txn.rollback();
-            throw new CloudRuntimeException("Error when finding sec storage " + cmd.getSecUrl(),
ex);
+            throw new CloudRuntimeException("Error when finding sec storage " + nfsUrl, ex);
         } finally {
             txn.close();
             txn = Transaction.open(Transaction.CLOUD_DB);
@@ -498,7 +505,7 @@ public class MockStorageManagerImpl extends ManagerBase implements MockStorageMa
                         .replaceAll(storage.getMountPoint(), ""), template.getSize(), template.getSize(),
true, false));
             }
             txn.commit();
-            return new ListTemplateAnswer(cmd.getSecUrl(), templateInfos);
+            return new ListTemplateAnswer(nfsUrl, templateInfos);
         } catch (Exception ex) {
             txn.rollback();
             throw new CloudRuntimeException("Error when finding template on sec storage "
+ storage.getId(), ex);


Mime
View raw message