- VpnMap vpnmap = NeutronvpnUtils.getVpnMap(broker, routerId);
- if (vpnmap != null) {
- // if yes, remove corresponding internal vpn
- LOG.trace("removing internal-vpn for router {}", routerId);
- nvpnManager.removeL3Vpn(routerId);
- } else {
- // if not, it is associated with some VPN
- // remove VPN-router association
- Uuid vpnId = NeutronvpnUtils.getVpnForRouter(broker, routerId);
- LOG.trace("dissociating router {} from vpn {}", routerId, vpnId);
- nvpnManager.dissociateRouterFromVpn(vpnId, routerId);
+ // fetch subnets associated to router
+ List<Interfaces> routerInterfaces = input.getInterfaces();
+ List<Uuid> routerSubnetIds = new ArrayList<Uuid>();
+ if (routerInterfaces != null) {
+ for (Interfaces rtrIf : routerInterfaces) {
+ routerSubnetIds.add(rtrIf.getSubnetId());
+ }