From cf7469241f6efcfd5d981b576997eb299d272c01 Mon Sep 17 00:00:00 2001 From: prachi Date: Tue, 17 Jan 2012 14:55:45 -0800 Subject: [PATCH] Bug 12822 - CreatePhysicalNetwork API shouldn't return success when zone is Enabled Changes: - Physical Network can be created pnly when the Zone is in disabled state --- server/src/com/cloud/network/NetworkManagerImpl.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index f4f3b310944..376484a2a58 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -4233,6 +4233,10 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag throw new InvalidParameterValueException("Please specify a valid zone."); } + if (Grouping.AllocationState.Enabled == zone.getAllocationState()) { + throw new PermissionDeniedException("Cannot create PhysicalNetwork since the Zone is currently enabled, zone Id: " + zoneId); + } + NetworkType zoneType = zone.getNetworkType(); if(zoneType == NetworkType.Basic){