From 88024bea6a4aa61875a759ef16429c93c1942fab Mon Sep 17 00:00:00 2001 From: kishan Date: Wed, 19 Jan 2011 16:30:12 +0530 Subject: [PATCH] bug 6928: throw error when router is not in stopped state while upgrading status 6928: resolved fixed --- .../network/router/VirtualNetworkApplianceManagerImpl.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 5a1b63ad434..f73cdd3c462 100644 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -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());