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
This commit is contained in:
prachi 2012-01-17 14:55:45 -08:00
parent 189822da50
commit cf7469241f
1 changed files with 4 additions and 0 deletions

View File

@ -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){