Skip to content

Commit 539fca3

Browse files
author
Prasanna Santhanam
committed
Simulator: Fixing the listTemplatesCommand
Should return the ListTemplatesAnswer and ListVolumes returns ListVolumesAnswer Signed-off-by: Prasanna Santhanam <tsp@apache.org>
1 parent bab974c commit 539fca3

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎plugins/hypervisors/simulator/src/com/cloud/agent/manager/MockStorageManagerImpl.java‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,13 +434,13 @@ public Answer ListVolumes(ListVolumeCommand cmd) {
434434
List<MockVolumeVO> volumes = _mockVolumeDao.findByStorageIdAndType(storage.getId(),
435435
MockVolumeType.VOLUME);
436436

437-
Map<String, TemplateInfo> templateInfos = new HashMap<String, TemplateInfo>();
437+
Map<Long, TemplateInfo> templateInfos = new HashMap<Long, TemplateInfo>();
438438
for (MockVolumeVO volume : volumes) {
439-
templateInfos.put(volume.getName(), new TemplateInfo(volume.getName(), volume.getPath()
439+
templateInfos.put(volume.getId(), new TemplateInfo(volume.getName(), volume.getPath()
440440
.replaceAll(storage.getMountPoint(), ""), volume.getSize(), volume.getSize(), true, false));
441441
}
442442
txn.commit();
443-
return new ListTemplateAnswer(cmd.getSecUrl(), templateInfos);
443+
return new ListVolumeAnswer(cmd.getSecUrl(), templateInfos);
444444
} catch (Exception ex) {
445445
txn.rollback();
446446
throw new CloudRuntimeException("Error when finding template on sec storage " + storage.getId(), ex);

0 commit comments

Comments
 (0)