mirror of https://github.com/apache/cloudstack.git
Allow network restart only for the networks in Setup and Implemented states.
This commit is contained in:
parent
cd27202a26
commit
7c7710c204
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue