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.
This commit is contained in:
Nitin Mehta 2013-12-12 13:13:16 -08:00
parent 6a63fb4461
commit 67785c2ad6
1 changed files with 4 additions and 3 deletions

View File

@ -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<? extends ResourceTag> tags = ApiDBUtils.listByResourceTypeAndId(ResourceObjectType.Snapshot, snapshot.getId());
List<ResourceTagResponse> tagResponses = new ArrayList<ResourceTagResponse>();