From b643a9a4beb995380954c8561e1c8535a24755f3 Mon Sep 17 00:00:00 2001 From: frank Date: Wed, 2 Nov 2011 14:35:14 -0700 Subject: [PATCH] Bug 11808 - Allow additional non-default virtual networks completed Java code change, need UI change in line with --- .../com/cloud/network/NetworkManagerImpl.java | 21 +++++++------------ 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index f9dd0fbaba8..fdd28303645 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -1687,21 +1687,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) {