cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wid...@apache.org
Subject [05/50] [abbrv] git commit: updated refs/heads/statscollector-graphite to e06a814
Date Tue, 11 Nov 2014 12:03:44 GMT
Check to see if the Map<String, String> of capabilities passed back from the storage
driver is null.

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

Branch: refs/heads/statscollector-graphite
Commit: 9338abb6f369dfa792b70335d216b5774c44dd1d
Parents: ebb96f5
Author: Mike Tutkowski <mike.tutkowski@solidfire.com>
Authored: Thu Nov 6 19:49:44 2014 -0700
Committer: Mike Tutkowski <mike.tutkowski@solidfire.com>
Committed: Thu Nov 6 19:49:44 2014 -0700

----------------------------------------------------------------------
 server/src/com/cloud/api/ApiResponseHelper.java        | 10 ++++++----
 server/src/com/cloud/template/TemplateManagerImpl.java | 10 ++++++----
 2 files changed, 12 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9338abb6/server/src/com/cloud/api/ApiResponseHelper.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java
index 8172987..f4be820 100755
--- a/server/src/com/cloud/api/ApiResponseHelper.java
+++ b/server/src/com/cloud/api/ApiResponseHelper.java
@@ -517,11 +517,13 @@ public class ApiResponseHelper implements ResponseGenerator {
 
         Map<String, String> mapCapabilities = dataStore.getDriver().getCapabilities();
 
-        String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
-        Boolean supportsStorageSystemSnapshots = new Boolean(value);
+        if (mapCapabilities != null) {
+            String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
+            Boolean supportsStorageSystemSnapshots = new Boolean(value);
 
-        if (supportsStorageSystemSnapshots) {
-            return DataStoreRole.Primary;
+            if (supportsStorageSystemSnapshots) {
+                return DataStoreRole.Primary;
+            }
         }
 
         return DataStoreRole.Image;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/9338abb6/server/src/com/cloud/template/TemplateManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/TemplateManagerImpl.java b/server/src/com/cloud/template/TemplateManagerImpl.java
index da3940c..0da602c 100755
--- a/server/src/com/cloud/template/TemplateManagerImpl.java
+++ b/server/src/com/cloud/template/TemplateManagerImpl.java
@@ -1485,11 +1485,13 @@ public class TemplateManagerImpl extends ManagerBase implements TemplateManager,
 
         Map<String, String> mapCapabilities = dataStore.getDriver().getCapabilities();
 
-        String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
-        Boolean supportsStorageSystemSnapshots = new Boolean(value);
+        if (mapCapabilities != null) {
+            String value = mapCapabilities.get(DataStoreCapabilities.STORAGE_SYSTEM_SNAPSHOT.toString());
+            Boolean supportsStorageSystemSnapshots = new Boolean(value);
 
-        if (supportsStorageSystemSnapshots) {
-            return DataStoreRole.Primary;
+            if (supportsStorageSystemSnapshots) {
+                return DataStoreRole.Primary;
+            }
         }
 
         return DataStoreRole.Image;


Mime
View raw message