GutoVeronezi commented on a change in pull request #5873:
URL: https://github.com/apache/cloudstack/pull/5873#discussion_r792581008



##########
File path: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
##########
@@ -2065,10 +2071,14 @@ public boolean restartNetwork(Long networkId, boolean 
cleanup, boolean makeRedun
     public boolean restartNetwork(RestartNetworkCmd cmd) throws 
ConcurrentOperationException, ResourceUnavailableException, 
InsufficientCapacityException {
         // This method restarts all network elements belonging to the network 
and re-applies all the rules
         Long networkId = cmd.getNetworkId();
+        NetworkVO network = getNetworkVO(cmd.getNetworkId(),"Nework to restart 
not found %s", String.valueOf(networkId));

Review comment:
       ```suggestion
           NetworkVO network = getNetworkVO(cmd.getNetworkId(), "Network [%s] 
to restart was not found.", String.valueOf(networkId));
   ```

##########
File path: server/src/main/java/com/cloud/network/NetworkServiceImpl.java
##########
@@ -1986,12 +1986,7 @@ public boolean deleteNetwork(long networkId, boolean 
forced) {
         Account caller = CallContext.current().getCallingAccount();
 
         // Verify network id
-        NetworkVO network = _networksDao.findById(networkId);
-        if (network == null) {
-            // see NetworkVO.java
-
-            throwInvalidIdException("unable to find network with specified 
id", String.valueOf(networkId), "networkId");
-        }
+        NetworkVO network = getNetworkVO(networkId, "unable to find network 
with specified id", String.valueOf(networkId));

Review comment:
       ```suggestion
           NetworkVO network = getNetworkVO(networkId, "Unable to find a 
network with the specified ID.", String.valueOf(networkId));
   ```




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to