bug 6928: throw error when router is not in stopped state while upgrading

status 6928: resolved fixed
This commit is contained in:
kishan 2011-01-19 16:30:12 +05:30
parent 1117eff8f9
commit 88024bea6a

View File

@ -369,6 +369,12 @@ public class VirtualNetworkApplianceManagerImpl implements VirtualNetworkApplian
if (newServiceOffering == null) {
throw new InvalidParameterValueException("Unable to find service offering with id " + serviceOfferingId);
}
// Check that the router is stopped
if (!router.getState().equals(State.Stopped)) {
s_logger.warn("Unable to upgrade router " + router.toString() + " in state " + router.getState());
throw new InvalidParameterValueException("Unable to upgrade router " + router.toString() + " in state " + router.getState() + "; make sure the router is stopped and not in an error state before upgrading.");
}
ServiceOfferingVO currentServiceOffering = _serviceOfferingDao.findById(router.getServiceOfferingId());