CLOUDSTACK-3078. Since no default value is set for the isolation type during the physical network creation,

modify guest vlan range dedication to check if the isolation type is VLAN only when an isolation type has been set
This commit is contained in:
Likitha Shetty 2013-06-20 11:53:41 +05:30
parent d3d6350219
commit 4a260672e0

View File

@ -2978,7 +2978,7 @@ public class NetworkServiceImpl extends ManagerBase implements NetworkService {
PhysicalNetworkVO physicalNetwork = _physicalNetworkDao.findById(physicalNetworkId);
if (physicalNetwork == null ) {
throw new InvalidParameterValueException("Unable to find physical network by id " + physicalNetworkId);
} else if (physicalNetwork.getIsolationMethods() == null || !physicalNetwork.getIsolationMethods().contains("VLAN")) {
} else if (physicalNetwork.getIsolationMethods() != null && !physicalNetwork.getIsolationMethods().contains("VLAN")) {
throw new InvalidParameterValueException("Cannot dedicate guest vlan range. " +
"Physical isolation type of network " + physicalNetworkId + " is not VLAN");
}