CS-14687: When a valid instance id that does not belong to the current user is passed to ec2-stop-instances,ec2-start-instances,ec2-terminate-instances, api does not return anythin

Changes:
Throw error if LookUpInstances fails to list the Vm by id.
This commit is contained in:
prachi 2012-05-07 16:06:17 -07:00
parent 3d0811ecb7
commit 4c163bfab0
1 changed files with 5 additions and 0 deletions

View File

@ -1795,6 +1795,11 @@ public class EC2Engine {
}
instances.addInstance(ec2Vm);
}
}else{
if(instanceId != null){
//no such instance found
throw new EC2ServiceException(ServerError.InternalError, "Instance:" + instanceId + " not found");
}
}
return instances;
}