From ee59c26e93c4f8a69ea624d1f411d62ffa02d4a9 Mon Sep 17 00:00:00 2001 From: Edison Su Date: Wed, 21 Sep 2011 19:11:37 -0700 Subject: [PATCH] bug 11513: another customer hits the same issue by associate ip in the basic zone Reviewed-by: alena@citrix.com --- server/src/com/cloud/network/NetworkManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index 18ecc17708b..0e3201c4e4f 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -552,7 +552,7 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag if (ipOwner == null) { throw new InvalidParameterValueException("Unable to find account " + accountName + " in domain " + domainId + ", permission denied"); } - + _accountMgr.checkAccess(caller, null, ipOwner); DataCenterVO zone = null; @@ -561,6 +561,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag if (zone == null) { throw new InvalidParameterValueException("Can't find zone by id " + zoneId); } + + if (zone.getNetworkType() == NetworkType.Basic) { + throw new InvalidParameterValueException("Can't associate ip in basic zone"); + } if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getType())) { throw new PermissionDeniedException("Cannot perform this operation, Zone is currently disabled: " + zoneId);