Skip to content

Commit a9412ba

Browse files
proper changes to use only enum of HypervisorType
1 parent f25e532 commit a9412ba

File tree

3 files changed

+4
-5
lines changed

3 files changed

+4
-5
lines changed

engine/storage/integration-test/src/test/java/org/apache/cloudstack/storage/test/VolumeServiceTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ public void testCreatePrimaryStorage() {
276276
params.put("path", uri.getPath());
277277
params.put("protocol", StoragePoolType.NetworkFilesystem);
278278
params.put("dcId", dcId.toString());
279+
params.put("hypervisorType", HypervisorType.None);
279280
params.put("clusterId", clusterId.toString());
280281
params.put("name", this.primaryName);
281282
params.put("port", "1");
@@ -318,6 +319,7 @@ public DataStore createPrimaryDataStore() {
318319
params.put("path", uri.getPath());
319320
params.put("protocol", Storage.StoragePoolType.NetworkFilesystem);
320321
params.put("dcId", dcId.toString());
322+
params.put("hypervisorType", HypervisorType.None);
321323
params.put("clusterId", clusterId.toString());
322324
params.put("name", this.primaryName);
323325
params.put("port", "1");

plugins/storage/volume/default/src/main/java/org/apache/cloudstack/storage/datastore/lifecycle/CloudStackPrimaryDataStoreLifeCycleImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,7 @@ public DataStore initialize(Map<String, Object> dsInfos) {
131131
Long zoneId = (Long)dsInfos.get("zoneId");
132132
String url = (String)dsInfos.get("url");
133133
String providerName = (String)dsInfos.get("providerName");
134-
HypervisorType hypervisorType = HypervisorType.None;
135-
if(dsInfos.containsKey("hypervisorType")) {
136-
hypervisorType = HypervisorType.getType(dsInfos.get("hypervisorType").toString());
137-
}
134+
HypervisorType hypervisorType = (HypervisorType)dsInfos.get("hypervisorType");
138135
if (clusterId != null && podId == null) {
139136
throw new InvalidParameterValueException("Cluster id requires pod id");
140137
}

server/src/main/java/com/cloud/storage/StorageManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -722,7 +722,7 @@ public PrimaryDataStoreInfo createPool(CreateStoragePoolCmd cmd) throws Resource
722722
params.put("zoneId", zone.getId());
723723
params.put("clusterId", clusterId);
724724
params.put("podId", podId);
725-
params.put("hypervisorType", hypervisorType.toString());
725+
params.put("hypervisorType", hypervisorType);
726726
params.put("url", cmd.getUrl());
727727
params.put("tags", cmd.getTags());
728728
params.put("name", cmd.getStoragePoolName());

0 commit comments

Comments
 (0)