From 9cf48bbfbd118c74b29a89de36f3c7dd4bd413cd Mon Sep 17 00:00:00 2001 From: alena Date: Fri, 25 Feb 2011 11:44:00 -0800 Subject: [PATCH] bug 8686: don't allow to create network from the network offering with Availability=Unavailable status 8686: resolved fixed --- server/src/com/cloud/network/NetworkManagerImpl.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/server/src/com/cloud/network/NetworkManagerImpl.java b/server/src/com/cloud/network/NetworkManagerImpl.java index cc68e3f503a..80281ee099c 100755 --- a/server/src/com/cloud/network/NetworkManagerImpl.java +++ b/server/src/com/cloud/network/NetworkManagerImpl.java @@ -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) {