EC2ImageAttributes imageAtts = new EC2ImageAttributes();
try {
imageAtts.setImageId(request.getImageId());
if (request.getAttribute().equals(ImageAttribute.launchPermission)) {
CloudStackTemplatePermission tempPerm = getApi().listTemplatePermissions(request.getImageId(), null, null);
if (tempPerm != null) {
imageAtts.setDomainId(tempPerm.getDomainId());
List<String> accntList = tempPerm.getAccounts();
imageAtts.setAccountNamesWithLaunchPermission(accntList);
imageAtts.setIsPublic(tempPerm.getIsPublic());
}
} else if (request.getAttribute().equals(ImageAttribute.description)) {
EC2DescribeImagesResponse descriptionResp = new EC2DescribeImagesResponse();
listTemplates(request.getImageId(), descriptionResp);
if (descriptionResp.getImageSet() != null) {