From 619674e21e9767ed61d9cdbab439dfedf3f292a5 Mon Sep 17 00:00:00 2001 From: Kishan Kavala Date: Thu, 2 Jan 2014 14:43:03 +0530 Subject: [PATCH] CLOUDSTACK-5656: Rules will remain in Revoked state when router upgrade is required. Filtered revoked rules while listing. Show genreric error since router is not visible to enduser. Conflicts: server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java --- .../cloud/network/firewall/FirewallManagerImpl.java | 2 ++ .../router/VirtualNetworkApplianceManagerImpl.java | 12 +++--------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java index 448abe317b6..af055fbbe56 100644 --- a/server/src/com/cloud/network/firewall/FirewallManagerImpl.java +++ b/server/src/com/cloud/network/firewall/FirewallManagerImpl.java @@ -284,6 +284,7 @@ public class FirewallManagerImpl extends ManagerBase implements FirewallService, sb.and("networkId", sb.entity().getNetworkId(), Op.EQ); sb.and("ip", sb.entity().getSourceIpAddressId(), Op.EQ); sb.and("purpose", sb.entity().getPurpose(), Op.EQ); + sb.and("state", sb.entity().getState(), Op.NEQ); if (tags != null && !tags.isEmpty()) { SearchBuilder tagSearch = _resourceTagDao.createSearchBuilder(); @@ -324,6 +325,7 @@ public class FirewallManagerImpl extends ManagerBase implements FirewallService, sc.setParameters("purpose", Purpose.Firewall); sc.setParameters("trafficType", trafficType); + sc.setParameters("state", State.Revoke); Pair, Integer> result = _firewallDao.searchAndCount(sc, filter); return new Pair, Integer>(result.first(), result.second()); diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java index 89041855aea..000ed483238 100755 --- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java +++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java @@ -3525,8 +3525,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V } protected boolean sendCommandsToRouter(final VirtualRouter router, Commands cmds) throws AgentUnavailableException { - if (!checkRouterVersion(router)) { - throw new CloudRuntimeException("Router requires upgrade. Unable to send command to router:" + router.getId()); + if(!checkRouterVersion(router)){ + s_logger.debug("Router requires upgrade. Unable to send command to router:" + router.getId()); + throw new CloudRuntimeException("Unable to send command. Upgrade in progress. Please contact administrator."); } Answer[] answers = null; try { @@ -3809,13 +3810,6 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase implements V continue; } - if (!checkRouterVersion(router)){ - //Rules will be applied after VR is upgraded - s_logger.debug("Router " + router.getInstanceName() + " requires upgrade, so not sending apply " + - typeString + " commands to the backend"); - continue; - } - try { result = applier.execute(network, router); connectedRouters.add(router);