Allow network restart only for the networks in Setup and Implemented states.

This commit is contained in:
alena 2011-02-28 12:22:35 -08:00
parent cd27202a26
commit 7c7710c204
1 changed files with 5 additions and 0 deletions

View File

@ -2147,6 +2147,11 @@ public class NetworkManagerImpl implements NetworkManager, NetworkService, Manag
throw new InvalidParameterValueException("Network with id=" + networkId + " doesn't exist");
}
//Don't allow to restart network if it's not in Implemented/Setup state
if (!(network.getState() == Network.State.Implemented || network.getState() == Network.State.Setup)) {
throw new InvalidParameterValueException("Network is not in the right state to be restarted. Correct states are: " + Network.State.Implemented + ", " + Network.State.Setup);
}
Account owner = _accountMgr.getAccount(network.getAccountId());
ReservationContext context = new ReservationContextImpl(null, null, caller, owner);