Bug 11808 - Allow additional non-default virtual networks

completed Java code change, need UI change in line with
This commit is contained in:
frank 2011-11-02 14:35:14 -07:00
parent 15a8c015ea
commit 720ffc2d1f
1 changed files with 7 additions and 14 deletions

View File

@ -1682,21 +1682,14 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
throw new InvalidParameterValueException("Network creation is not allowed in zone with network type " + NetworkType.Basic);
}
// allow isDefault/isShared to be set only for Direct network
if (networkOffering.getGuestType() == GuestIpType.Virtual) {
if (isDefault != null && !isDefault) {
throw new InvalidParameterValueException("Can specify isDefault parameter only for Direct network.");
} else {
isDefault = true;
}
if (isShared != null && isShared) {
throw new InvalidParameterValueException("Can specify isShared parameter for Direct networks only");
}
} else {
if (isDefault == null) {
isDefault = false;
}
if (isDefault == null) {
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");
}
// if network is shared, defult its owner to be system
if (isShared) {