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
This commit is contained in:
Kishan Kavala 2014-01-02 14:43:03 +05:30
parent 48c47101aa
commit 619674e21e
2 changed files with 5 additions and 9 deletions

View File

@ -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<ResourceTagVO> 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<List<FirewallRuleVO>, Integer> result = _firewallDao.searchAndCount(sc, filter);
return new Pair<List<? extends FirewallRule>, Integer>(result.first(), result.second());

View File

@ -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);