Skip to content

Commit 6eba8a8

Browse files
author
Alena Prokharchyk
committed
VPC: applyStaticRoutes - don't exclude static routes in Revoke state
1 parent 6aee5f2 commit 6eba8a8

1 file changed

Lines changed: 5 additions & 18 deletions

File tree

‎server/src/com/cloud/network/router/VpcVirtualNetworkApplianceManagerImpl.java‎

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -831,15 +831,12 @@ public boolean finalizeCommandsOnStart(Commands cmds, VirtualMachineProfile<Doma
831831
List<StaticRouteProfile> staticRouteProfiles = new ArrayList<StaticRouteProfile>(routes.size());
832832
Map<Long, VpcGateway> gatewayMap = new HashMap<Long, VpcGateway>();
833833
for (StaticRoute route : routes) {
834-
if (route.getState() != StaticRoute.State.Revoke) {
835-
//skip static route in revoke state
836-
VpcGateway gateway = gatewayMap.get(route.getVpcGatewayId());
837-
if (gateway == null) {
838-
gateway = _vpcMgr.getVpcGateway(route.getVpcGatewayId());
839-
gatewayMap.put(gateway.getId(), gateway);
840-
}
841-
staticRouteProfiles.add(new StaticRouteProfile(route, gateway));
834+
VpcGateway gateway = gatewayMap.get(route.getVpcGatewayId());
835+
if (gateway == null) {
836+
gateway = _vpcMgr.getVpcGateway(route.getVpcGatewayId());
837+
gatewayMap.put(gateway.getId(), gateway);
842838
}
839+
staticRouteProfiles.add(new StaticRouteProfile(route, gateway));
843840
}
844841

845842
s_logger.debug("Found " + staticRouteProfiles.size() + " static routes to apply as a part of vpc route "
@@ -1018,16 +1015,6 @@ public boolean applyStaticRoutes(List<StaticRouteProfile> staticRoutes, List<Dom
10181015
return true;
10191016
}
10201017

1021-
//exclude static route in Revoke state
1022-
Iterator<StaticRouteProfile> it = staticRoutes.iterator();
1023-
while (it.hasNext()) {
1024-
StaticRouteProfile profile = it.next();
1025-
if (profile.getState() == StaticRoute.State.Revoke) {
1026-
s_logger.debug("Not sending static route " + profile + " because its in " + StaticRoute.State.Revoke + " state");
1027-
it.remove();
1028-
}
1029-
}
1030-
10311018
boolean result = true;
10321019
for (VirtualRouter router : routers) {
10331020
if (router.getState() == State.Running) {

0 commit comments

Comments
 (0)