bug 8849: Don't allow create Guest Virtual and Direct shared networks in Security Group enabled zone

status 8849: resolved fixed
This commit is contained in:
alena 2011-03-09 18:17:01 -08:00
parent df3704e360
commit 37d9b5ab50

View File

@ -1520,8 +1520,8 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
throw new InvalidParameterValueException("Network creation is not allowed in zone with network type " + NetworkType.Basic);
}
if (zone.isSecurityGroupEnabled() && networkOffering.getGuestType() == GuestIpType.Virtual) {
throw new InvalidParameterValueException("Virtual Network creation is not allowd if zone is security group enabled");
if (zone.isSecurityGroupEnabled() && (networkOffering.getGuestType() == GuestIpType.Virtual || (isShared != null && isShared))) {
throw new InvalidParameterValueException("Virtual Network and Direct Shared Network creation is not allowed if zone is security group enabled");
}
if (zone.isSecurityGroupEnabled() && cmd.getAccountName() == null) {