bug 6141: fixed the error of not providing the right error for an incorrect diskoffering

status 6141: resolved fixed
This commit is contained in:
abhishek 2010-09-16 14:59:17 -07:00
parent dbde0cd39b
commit 3abe056736
1 changed files with 8 additions and 0 deletions

View File

@ -117,6 +117,14 @@ public class CreateVolumeCmd extends BaseCmd {
size = Long.valueOf(0);
}
if(diskOfferingId != null){
DiskOfferingVO dOffering = getManagementServer().findDiskOfferingById(diskOfferingId.longValue());
if(dOffering == null){
throw new ServerApiException(BaseCmd.PARAM_ERROR,"Diskoffering id:"+diskOfferingId+" is invalid");
}
}
boolean useSnapshot = false;
if (snapshotId == null)
{