VPC: CS-16179 - only offerings in Enabled state can be used for VPC creation

Reviewed-by: Frank Zhang

Conflicts:

	server/src/com/cloud/network/vpc/VpcManagerImpl.java
This commit is contained in:
Alena Prokharchyk 2012-08-27 11:04:10 -07:00
parent 3609e44b58
commit 48806fcc54
1 changed files with 3 additions and 2 deletions

View File

@ -528,8 +528,9 @@ public class VpcManagerImpl implements VpcManager, Manager{
// Validate vpc offering
VpcOfferingVO vpcOff = _vpcOffDao.findById(vpcOffId);
if (vpcOff == null) {
InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering by specified id");
if (vpcOff == null || vpcOff.getState() != State.Enabled) {
InvalidParameterValueException ex = new InvalidParameterValueException("Unable to find vpc offering in " + State.Enabled +
" state by specified id");
ex.addProxyObject("vpc_offerings", vpcOffId, "vpcOfferingId");
throw ex;
}