cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t..@apache.org
Subject git commit: updated refs/heads/4.2 to 908df7a
Date Sun, 28 Jul 2013 04:50:33 GMT
Updated Branches:
  refs/heads/4.2 d6faf7b58 -> 908df7aab


Fix simulator and marvin

- Remove additional parantheses in marvin VirtualMachine.create(
- Implement createEntityExtractUrl command for simulator

Signed-off-by: Prasanna Santhanam <tsp@apache.org>


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

Branch: refs/heads/4.2
Commit: 908df7aabdd7bfca1d0a3c1b39a83111b61ee692
Parents: d6faf7b
Author: Prasanna Santhanam <tsp@apache.org>
Authored: Sun Jul 28 10:18:39 2013 +0530
Committer: Prasanna Santhanam <tsp@apache.org>
Committed: Sun Jul 28 10:20:16 2013 +0530

----------------------------------------------------------------------
 .../driver/SimulatorImageStoreDriverImpl.java   | 36 ++++++++++++--------
 tools/marvin/marvin/integration/lib/base.py     |  2 +-
 2 files changed, 23 insertions(+), 15 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/908df7aa/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/driver/SimulatorImageStoreDriverImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/driver/SimulatorImageStoreDriverImpl.java
b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/driver/SimulatorImageStoreDriverImpl.java
index b230194..e18f8e5 100644
--- a/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/driver/SimulatorImageStoreDriverImpl.java
+++ b/plugins/hypervisors/simulator/src/org/apache/cloudstack/storage/datastore/driver/SimulatorImageStoreDriverImpl.java
@@ -26,31 +26,26 @@ import com.cloud.agent.api.to.DataStoreTO;
 import com.cloud.agent.api.to.NfsTO;
 import com.cloud.storage.Storage;
 import com.cloud.storage.VMTemplateStorageResourceAssoc;
-import com.cloud.storage.VMTemplateVO;
-import com.cloud.storage.VolumeVO;
 import com.cloud.storage.dao.VMTemplateDao;
 import com.cloud.storage.dao.VolumeDao;
 import org.apache.cloudstack.engine.subsystem.api.storage.CreateCmdResult;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataObject;
 import org.apache.cloudstack.engine.subsystem.api.storage.DataStore;
-import org.apache.cloudstack.engine.subsystem.api.storage.ObjectInDataStoreStateMachine;
+import org.apache.cloudstack.engine.subsystem.api.storage.EndPoint;
+import org.apache.cloudstack.engine.subsystem.api.storage.EndPointSelector;
 import org.apache.cloudstack.framework.async.AsyncCallbackDispatcher;
 import org.apache.cloudstack.framework.async.AsyncCompletionCallback;
-import org.apache.cloudstack.framework.async.AsyncRpcContext;
 import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreDao;
-import org.apache.cloudstack.storage.datastore.db.TemplateDataStoreVO;
 import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreDao;
-import org.apache.cloudstack.storage.datastore.db.VolumeDataStoreVO;
 import org.apache.cloudstack.storage.image.BaseImageStoreDriverImpl;
 import org.apache.cloudstack.storage.image.store.ImageStoreImpl;
-import org.apache.cloudstack.storage.to.TemplateObjectTO;
-import org.apache.cloudstack.storage.to.VolumeObjectTO;
+import org.apache.log4j.Logger;
 
 import javax.inject.Inject;
-import java.util.Date;
 import java.util.UUID;
 
 public class SimulatorImageStoreDriverImpl extends BaseImageStoreDriverImpl {
+    private static final Logger s_logger = Logger.getLogger(SimulatorImageStoreDriverImpl.class);
 
     @Inject
     TemplateDataStoreDao _templateStoreDao;
@@ -60,6 +55,8 @@ public class SimulatorImageStoreDriverImpl extends BaseImageStoreDriverImpl
{
     VolumeDao _volumeDao;
     @Inject
     VolumeDataStoreDao _volumeStoreDao;
+    @Inject
+    EndPointSelector _epSelector;
 
     @Override
     public DataStoreTO getStoreTO(DataStore store) {
@@ -71,11 +68,6 @@ public class SimulatorImageStoreDriverImpl extends BaseImageStoreDriverImpl
{
     }
 
 
-
-    public String createEntityExtractUrl(DataStore store, String installPath, Storage.ImageFormat
format) {
-        return null;
-    }
-
     @Override
     public void createAsync(DataStore dataStore, DataObject data, AsyncCompletionCallback<CreateCmdResult>
callback) {
         if (data.getType() == DataObjectType.TEMPLATE) {
@@ -112,4 +104,20 @@ public class SimulatorImageStoreDriverImpl extends BaseImageStoreDriverImpl
{
         caller.complete(answer);
         return;
     }
+
+    @Override
+    public String createEntityExtractUrl(DataStore store, String installPath, Storage.ImageFormat
format, DataObject dataObject) {
+        EndPoint ep = _epSelector.select(store);
+        // Create Symlink at ssvm
+        String path = installPath;
+        String uuid = UUID.randomUUID().toString() + "." + format.getFileExtension();
+        // Construct actual URL locally now that the symlink exists at SSVM
+        return generateCopyUrl(ep.getPublicAddr(), uuid);
+    }
+
+    private String generateCopyUrl(String ipAddress, String uuid){
+        String hostname = ipAddress;
+        String scheme = "http";
+        return scheme + "://" + hostname + "/userdata/" + uuid;
+    }
 }
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/908df7aa/tools/marvin/marvin/integration/lib/base.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/integration/lib/base.py b/tools/marvin/marvin/integration/lib/base.py
index 18cdb68..d927c2a 100755
--- a/tools/marvin/marvin/integration/lib/base.py
+++ b/tools/marvin/marvin/integration/lib/base.py
@@ -376,7 +376,7 @@ class VirtualMachine:
             cmd.hostid = hostid
 
         if "userdata" in services:
-            cmd.userdata = base64.urlsafe_b64encode(services["userdata"]))
+            cmd.userdata = base64.urlsafe_b64encode(services["userdata"])
 
         if group:
             cmd.group = group


Mime
View raw message