VPC: CS-15725 - don't allow regular offering upgrade to the offering that can be used inside vpc only

This commit is contained in:
Alena Prokharchyk 2012-07-27 11:28:42 -07:00
parent e0c85c0d41
commit 9be0a5525d

View File

@ -4718,6 +4718,14 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
}
//can't update from vpc to non-vpc network offering
boolean forVpcNew = _configMgr.isOfferingForVpc(networkOffering);
boolean vorVpcOriginal = _configMgr.isOfferingForVpc(_configMgr.getNetworkOffering(oldNetworkOfferingId));
if (forVpcNew != vorVpcOriginal) {
String errMsg = forVpcNew ? "a vpc offering " : "not a vpc offering";
throw new InvalidParameterValueException("Can't update as the new offering is " + errMsg);
}
//can't update from vpc to non-vpc network offering
boolean forVpcNew = _configMgr.isOfferingForVpc(networkOffering);
boolean vorVpcOriginal = _configMgr.isOfferingForVpc(_configMgr.getNetworkOffering(oldNetworkOfferingId));