JoaoJandre commented on code in PR #8462:
URL: https://github.com/apache/cloudstack/pull/8462#discussion_r1448861184


##########
engine/orchestration/src/main/java/org/apache/cloudstack/engine/orchestration/NetworkOrchestrator.java:
##########
@@ -3017,24 +3017,15 @@ protected void 
checkL2OfferingServices(NetworkOfferingVO ntwkOff) {
     @Override
     @DB
     public boolean shutdownNetwork(final long networkId, final 
ReservationContext context, final boolean cleanupElements) {
-        NetworkVO network = _networksDao.findById(networkId);
-        if (network.getState() == Network.State.Allocated) {
-            s_logger.debug("Network is already shutdown: " + network);
-            return true;
-        }
-
-        if (network.getState() != Network.State.Implemented && 
network.getState() != Network.State.Shutdown) {
-            s_logger.debug("Network is not implemented: " + network);
-            return false;
-        }
-
+        NetworkVO network = null;
         try {
             //do global lock for the network
             network = _networksDao.acquireInLockTable(networkId, 
NetworkLockTimeout.value());
             if (network == null) {
-                s_logger.warn("Unable to acquire lock for the network " + 
network + " as a part of network shutdown");
+                s_logger.warn("Network with id: " + networkId + " doesn't 
exists, or unable to acquire lock as a part of network shutdown");

Review Comment:
   ```suggestion
                   s_logger.warn("Network with id: " + networkId + " doesn't 
exist, or unable to acquire lock for it as a part of network shutdown");
   ```



-- 
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