From 67785c2ad683342ebe0622db955db505b499a6c7 Mon Sep 17 00:00:00 2001 From: Nitin Mehta Date: Thu, 12 Dec 2013 13:13:16 -0800 Subject: [PATCH] CLOUDSTACK-5283: Not able to list snapshots when few snapshots are in "CreatedOnPrimary" state. Dont throw an exception when snapshot doesnt have an entry in the snapshot store ref for the snapshot in Image store because that fails to list all snapshots and also it can a perfect use case when the backup flag is not turned on. --- server/src/com/cloud/api/ApiResponseHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server/src/com/cloud/api/ApiResponseHelper.java b/server/src/com/cloud/api/ApiResponseHelper.java index b74ebf18db8..8cfc8596aff 100755 --- a/server/src/com/cloud/api/ApiResponseHelper.java +++ b/server/src/com/cloud/api/ApiResponseHelper.java @@ -462,11 +462,12 @@ public class ApiResponseHelper implements ResponseGenerator { } if (snapshotInfo == null) { - throw new CloudRuntimeException("Unable to find info for image store snapshot with uuid '"+snapshot.getUuid()+"'"); + s_logger.debug("Unable to find info for image store snapshot with uuid "+snapshot.getUuid()); + snapshotResponse.setRevertable(false); + }else{ + snapshotResponse.setRevertable(snapshotInfo.isRevertable()); } - snapshotResponse.setRevertable(snapshotInfo.isRevertable()); - // set tag information List tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Snapshot, snapshot.getId()); List tagResponses = new ArrayList();