From 1dbd012fdc2e4d5fce053f1c1d8a8c4bf73d4229 Mon Sep 17 00:00:00 2001 From: alena Date: Fri, 25 Feb 2011 10:12:46 -0800 Subject: [PATCH] bug 8720: don't allow to create network with custom vlan when networkOffering's guest IP type is Virtual status 8720: resolved fixed --- server/src/com/cloud/network/NetworkManagerImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index 05189b882e9..f122fb89feb 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -1529,12 +1529,17 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag } } + //Don't allow to create guest virtual network with Vlan specified + if (networkOffering.getGuestType() == GuestIpType.Virtual && vlanId != null) { + throw new InvalidParameterValueException("Can't specify vlan when create network with Guest IP Type " + GuestIpType.Virtual); + } + //Regular user can create guest network only if (ctxAccount.getType() == Account.ACCOUNT_TYPE_NORMAL && networkOffering.getTrafficType() != TrafficType.Guest) { throw new InvalidParameterValueException("Regular user can create a network only from the network offering having traffic type " + TrafficType.Guest); } - //Don't allow to specify cidr/gateway/vlan if the caller is a regular user + //Don't allow to specify cidr if the caller is a regular user if (ctxAccount.getType() == Account.ACCOUNT_TYPE_NORMAL && cidr != null) { throw new InvalidParameterValueException("Regular user is not allowed to specify gateway/netmask/ipRange"); }