Bug 11808 - Allow additional non-default virtual networks

when isDefault is null, for virtual network set defaut to true, false for direct network
This commit is contained in:
frank 2011-11-03 15:10:42 -07:00
parent a7cf2f412c
commit 0ad145cc94
1 changed files with 8 additions and 4 deletions

View File

@ -1687,10 +1687,14 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
throw new InvalidParameterValueException("Network creation is not allowed in zone with network type " + NetworkType.Basic);
}
if (isDefault == null) {
isDefault = false;
}
if (isDefault == null) {
if (networkOffering.getGuestType() == GuestIpType.Virtual) {
isDefault = true;
} else {
isDefault = false;
}
}
// allow isDefault/isShared to be set only for Direct network
if (networkOffering.getGuestType() == GuestIpType.Virtual && isShared != null && isShared) {
throw new InvalidParameterValueException("Can specify isShared parameter for Direct networks only");