From 8f67524fc58fedad65a17e8c9bbc9c039b63e1d4 Mon Sep 17 00:00:00 2001 From: anthony Date: Tue, 5 Jul 2011 17:53:22 -0700 Subject: [PATCH] bug 10591: can not return listResponse for Async command status 10591: resolved fixed --- api/src/com/cloud/api/commands/CreateTemplateCmd.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/api/src/com/cloud/api/commands/CreateTemplateCmd.java b/api/src/com/cloud/api/commands/CreateTemplateCmd.java index 47990092b53..8592459bf34 100755 --- a/api/src/com/cloud/api/commands/CreateTemplateCmd.java +++ b/api/src/com/cloud/api/commands/CreateTemplateCmd.java @@ -189,9 +189,11 @@ public class CreateTemplateCmd extends BaseAsyncCreateCmd { UserContext.current().setEventDetails("Template Id: "+getEntityId()+((getSnapshotId() == null) ? " from volume Id: " + getVolumeId() : " from snapshot Id: " + getSnapshotId())); VirtualMachineTemplate template = _userVmService.createPrivateTemplate(this); if (template != null){ - ListResponse response = new ListResponse(); List templateResponses = _responseGenerator.createTemplateResponses(template.getId(), snapshotId, volumeId, false); - response.setResponses(templateResponses); + TemplateResponse response = new TemplateResponse(); + if (templateResponses != null && !templateResponses.isEmpty()) { + response = templateResponses.get(0); + } response.setResponseName(getCommandName()); this.setResponseObject(response); } else {