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 0d580cc
Date Sun, 12 May 2013 05:01:03 GMT
Updated Branches:
  refs/heads/object_store 1bd216fc4 -> 0d580ccb2


Fix NPE in adding host and also put back lost change in deployDataCenter
due to rebase with master.

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

Branch: refs/heads/object_store
Commit: 0d580ccb26e55f0d17e04a98f470116bef6073b2
Parents: 1bd216f
Author: Min Chen <min.chen@citrix.com>
Authored: Sat May 11 22:00:40 2013 -0700
Committer: Min Chen <min.chen@citrix.com>
Committed: Sat May 11 22:00:40 2013 -0700

----------------------------------------------------------------------
 .../storage/image/TemplateServiceImpl.java         |    8 +++-
 .../src/com/cloud/storage/StorageManagerImpl.java  |    2 +-
 tools/devcloud/devcloud_s3.cfg                     |    2 +-
 tools/marvin/marvin/deployDataCenter.py            |   25 +++++++++++++--
 4 files changed, 30 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d580ccb/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 0572475..bf8155b 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
@@ -463,7 +463,9 @@ public class TemplateServiceImpl implements TemplateService {
         if (callbackResult.isFailed()) {
             template.processEvent(ObjectInDataStoreStateMachine.Event.OperationFailed);
             result.setResult(callbackResult.getResult());
-            parentCallback.complete(result);
+            if ( parentCallback != null ){
+                parentCallback.complete(result);
+            }
             return null;
         }
 
@@ -471,7 +473,9 @@ public class TemplateServiceImpl implements TemplateService {
             template.processEvent(ObjectInDataStoreStateMachine.Event.OperationSuccessed);
         } catch (Exception e) {
             result.setResult(e.toString());
-            parentCallback.complete(result);
+            if ( parentCallback != null ){
+                parentCallback.complete(result);
+            }
             return null;
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d580ccb/server/src/com/cloud/storage/StorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StorageManagerImpl.java b/server/src/com/cloud/storage/StorageManagerImpl.java
index 4ff590e..f03e9f9 100755
--- a/server/src/com/cloud/storage/StorageManagerImpl.java
+++ b/server/src/com/cloud/storage/StorageManagerImpl.java
@@ -736,7 +736,7 @@ public class StorageManagerImpl extends ManagerBase implements StorageManager,
C
                         DataStoreRole.Primary);
             }
 
-            HostScope scope = new HostScope(host.getId(), pool.getDataCenterId());
+            HostScope scope = new HostScope(host.getId(), host.getDataCenterId());
             lifeCycle.attachHost(store, scope, pInfo);
         } catch (Exception e) {
             s_logger.warn("Unable to setup the local storage pool for " + host, e);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d580ccb/tools/devcloud/devcloud_s3.cfg
----------------------------------------------------------------------
diff --git a/tools/devcloud/devcloud_s3.cfg b/tools/devcloud/devcloud_s3.cfg
index ea50564..18efec3 100644
--- a/tools/devcloud/devcloud_s3.cfg
+++ b/tools/devcloud/devcloud_s3.cfg
@@ -106,7 +106,7 @@
             ],
             "cacheStorages": [
                 {
-                    "url": "nfs://192.168.56.10/opt/storage/cache",
+                    "url": "nfs://192.168.56.10/opt/storage/secondary",
                     "providerName": "NFS",
                     "details": [
                     ]

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d580ccb/tools/marvin/marvin/deployDataCenter.py
----------------------------------------------------------------------
diff --git a/tools/marvin/marvin/deployDataCenter.py b/tools/marvin/marvin/deployDataCenter.py
index 2168592..dd6db05 100644
--- a/tools/marvin/marvin/deployDataCenter.py
+++ b/tools/marvin/marvin/deployDataCenter.py
@@ -138,10 +138,28 @@ class deployDataCenters():
         if secondaryStorages is None:
             return
         for secondary in secondaryStorages:
-            secondarycmd = addSecondaryStorage.addSecondaryStorageCmd()
+            secondarycmd = addImageStore.addImageStoreCmd()
             secondarycmd.url = secondary.url
-            secondarycmd.zoneid = zoneId
-            self.apiClient.addSecondaryStorage(secondarycmd)
+            secondarycmd.provider = secondary.providerName
+            secondarycmd.details = []
+            for item in secondary.details:
+                secondarycmd.details.append(item.__dict__)
+            if secondarycmd.provider == "NFS":
+                secondarycmd.zoneid = zoneId
+            self.apiClient.addImageStore(secondarycmd)
+
+    def createCacheStorages(self, cacheStorages, zoneId):
+        if cacheStorages is None:
+            return
+        for cache in cacheStorages:
+            cachecmd = createCacheStore.createCacheStoreCmd()
+            cachecmd.url = cache.url
+            cachecmd.provider = cache.providerName
+            cachecmd.zoneid = zoneId
+            cachecmd.details = []
+            for item in cache.details:
+                cachecmd.details.append(item.__dict__)
+            self.apiClient.createCacheStore(cachecmd)
 
     def createnetworks(self, networks, zoneId):
         if networks is None:
@@ -328,6 +346,7 @@ class deployDataCenters():
                                         zoneId)
 
             self.createSecondaryStorages(zone.secondaryStorages, zoneId)
+            self.createCacheStorages(zone.cacheStorages, zoneId)            
             
             enabled = getattr(zone, 'enabled', 'True')
             if enabled == 'True' or enabled is None:


Mime
View raw message