mirror of https://github.com/apache/cloudstack.git
Check to see if the Map<String, String> of capabilities passed back from the storage driver is null.
This commit is contained in:
parent
ebb96f5e2f
commit
9338abb6f3
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue