vishesh92 commented on code in PR #9251:
URL: https://github.com/apache/cloudstack/pull/9251#discussion_r1639739261


##########
server/src/main/java/com/cloud/network/element/VpcVirtualRouterElement.java:
##########
@@ -285,30 +318,7 @@ public boolean prepare(final Network network, final 
NicProfile nic, final Virtua
 
     @Override
     public boolean shutdown(final Network network, final ReservationContext 
context, final boolean cleanup) throws ConcurrentOperationException, 
ResourceUnavailableException {
-        final Long vpcId = network.getVpcId();
-        if (vpcId == null) {
-            s_logger.debug("Network " + network + " doesn't belong to any vpc, 
so skipping unplug nic part");
-            return true;
-        }
-
-        boolean success = true;
-        final List<? extends VirtualRouter> routers = 
_routerDao.listByVpcId(vpcId);
-        for (final VirtualRouter router : routers) {
-            // 1) Check if router is already a part of the network
-            if (!_networkMdl.isVmPartOfNetwork(router.getId(), 
network.getId())) {
-                s_logger.debug("Router " + router + " is not a part the 
network " + network);
-                continue;
-            }
-            // 2) Call unplugNics in the network service
-            success = success && 
_vpcRouterMgr.removeVpcRouterFromGuestNetwork(router, network);
-            if (!success) {
-                s_logger.warn("Failed to unplug nic in network " + network + " 
for virtual router " + router);
-            } else {
-                s_logger.debug("Successfully unplugged nic in network " + 
network + " for virtual router " + router);
-            }
-        }
-
-        return success;
+        return destroy(network, context);

Review Comment:
   destroy method has the same implementation. The only difference is the name 
of the network parameter is config instead of network.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to