bug 10359: don't allow system network deletion

status 10359: resolved fixed
This commit is contained in:
alena 2011-06-20 09:22:00 -07:00
parent 79e38f0a1f
commit 6a12a1c3cf

View File

@ -1959,6 +1959,12 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
if (network == null) {
throw new InvalidParameterValueException("unable to find network " + networkId);
}
//don't allow to delete system network
NetworkOffering offering = _networkOfferingDao.findByIdIncludingRemoved(network.getNetworkOfferingId());
if (offering.isSystemOnly()) {
throw new InvalidParameterValueException("Network id=" + networkId + " is system and can't be removed");
}
Account owner = _accountMgr.getAccount(network.getAccountId());