From 0b01c001857231e576b641b0ac9c1684ba7be2bb Mon Sep 17 00:00:00 2001 From: Alena Prokharchyk Date: Mon, 27 Aug 2012 11:04:10 -0700 Subject: [PATCH] VPC: CS-16179 - only offerings in Enabled state can be used for VPC creation Reviewed-by: Frank Zhang --- server/src/com/cloud/network/vpc/VpcManagerImpl.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server/src/com/cloud/network/vpc/VpcManagerImpl.java b/server/src/com/cloud/network/vpc/VpcManagerImpl.java index 8124df233ca..56f22f3c805 100644 --- a/server/src/com/cloud/network/vpc/VpcManagerImpl.java +++ b/server/src/com/cloud/network/vpc/VpcManagerImpl.java @@ -524,10 +524,11 @@ public class VpcManagerImpl implements VpcManager, Manager{ // Validate vpc offering VpcOfferingVO vpcOff = _vpcOffDao.findById(vpcOffId); - if (vpcOff == null) { + if (vpcOff == null || vpcOff.getState() != State.Enabled) { List idList = new ArrayList(); idList.add(new IdentityProxy("vpc_offerings", vpcOffId, "vpcOfferingId")); - throw new InvalidParameterValueException("Unable to find vpc offering by specified id", idList); + throw new InvalidParameterValueException("Unable to find vpc offering in " + State.Enabled + + " state by specified id", idList); } //Validate zone