bug 8686: don't allow to create network from the network offering with Availability=Unavailable

status 8686: resolved fixed
This commit is contained in:
alena 2011-02-25 11:44:00 -08:00
parent fdbdba7a78
commit 9cf48bbfbd
1 changed files with 5 additions and 0 deletions

View File

@ -1456,6 +1456,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
if (networkOffering == null || networkOffering.isSystemOnly()) {
throw new InvalidParameterValueException("Unable to find network offeirng by id " + networkOfferingId);
}
//Check if network offering is Available
if (networkOffering.getAvailability() == Availability.Unavailable) {
throw new InvalidParameterValueException("Can't create network; network offering id=" + networkOfferingId + " is " + networkOffering.getAvailability());
}
// allow isDefault to be set only for Direct network
if (networkOffering.getGuestType() == GuestIpType.Virtual) {