Simulator: Fixing the listTemplatesCommand

Should return the ListTemplatesAnswer and ListVolumes returns
ListVolumesAnswer

Signed-off-by: Prasanna Santhanam <tsp@apache.org>
This commit is contained in:
Prasanna Santhanam 2012-12-26 19:20:32 -08:00
parent bab974c3bc
commit 539fca3520
1 changed files with 3 additions and 3 deletions

View File

@ -434,13 +434,13 @@ public class MockStorageManagerImpl implements MockStorageManager {
List<MockVolumeVO> volumes = _mockVolumeDao.findByStorageIdAndType(storage.getId(),
MockVolumeType.VOLUME);
Map<String, TemplateInfo> templateInfos = new HashMap<String, TemplateInfo>();
Map<Long, TemplateInfo> templateInfos = new HashMap<Long, TemplateInfo>();
for (MockVolumeVO volume : volumes) {
templateInfos.put(volume.getName(), new TemplateInfo(volume.getName(), volume.getPath()
templateInfos.put(volume.getId(), new TemplateInfo(volume.getName(), volume.getPath()
.replaceAll(storage.getMountPoint(), ""), volume.getSize(), volume.getSize(), true, false));
}
txn.commit();
return new ListTemplateAnswer(cmd.getSecUrl(), templateInfos);
return new ListVolumeAnswer(cmd.getSecUrl(), templateInfos);
} catch (Exception ex) {
txn.rollback();
throw new CloudRuntimeException("Error when finding template on sec storage " + storage.getId(), ex);