You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by al...@apache.org on 2012/08/03 23:33:31 UTC
[5/30] git commit: VPC: applyStaticRoutes - don't exclude static
routes in Revoke state
VPC: applyStaticRoutes - don't exclude static routes in Revoke state
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/6eba8a81
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/6eba8a81
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/6eba8a81
Branch: refs/heads/vpc
Commit: 6eba8a818a9ac4c6affec5b1becded8257bf3d9f
Parents: 6aee5f2
Author: Alena Prokharchyk <al...@citrix.com>
Authored: Thu Aug 2 18:42:14 2012 -0700
Committer: Alena Prokharchyk <al...@citrix.com>
Committed: Fri Aug 3 14:15:50 2012 -0700
----------------------------------------------------------------------
.../VpcVirtualNetworkApplianceManagerImpl.java | 23 +++-----------
1 files changed, 5 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/6eba8a81/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
index af1c569..e60598d 100644
--- a/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java
@@ -831,15 +831,12 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
List<StaticRouteProfile> staticRouteProfiles = new ArrayList<StaticRouteProfile>(routes.size());
Map<Long, VpcGateway> gatewayMap = new HashMap<Long, VpcGateway>();
for (StaticRoute route : routes) {
- if (route.getState() != StaticRoute.State.Revoke) {
- //skip static route in revoke state
- VpcGateway gateway = gatewayMap.get(route.getVpcGatewayId());
- if (gateway == null) {
- gateway = _vpcMgr.getVpcGateway(route.getVpcGatewayId());
- gatewayMap.put(gateway.getId(), gateway);
- }
- staticRouteProfiles.add(new StaticRouteProfile(route, gateway));
+ VpcGateway gateway = gatewayMap.get(route.getVpcGatewayId());
+ if (gateway == null) {
+ gateway = _vpcMgr.getVpcGateway(route.getVpcGatewayId());
+ gatewayMap.put(gateway.getId(), gateway);
}
+ staticRouteProfiles.add(new StaticRouteProfile(route, gateway));
}
s_logger.debug("Found " + staticRouteProfiles.size() + " static routes to apply as a part of vpc route "
@@ -1018,16 +1015,6 @@ public class VpcVirtualNetworkApplianceManagerImpl extends VirtualNetworkApplian
return true;
}
- //exclude static route in Revoke state
- Iterator<StaticRouteProfile> it = staticRoutes.iterator();
- while (it.hasNext()) {
- StaticRouteProfile profile = it.next();
- if (profile.getState() == StaticRoute.State.Revoke) {
- s_logger.debug("Not sending static route " + profile + " because its in " + StaticRoute.State.Revoke + " state");
- it.remove();
- }
- }
-
boolean result = true;
for (VirtualRouter router : routers) {
if (router.getState() == State.Running) {