You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2020/10/12 13:29:09 UTC

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4396: Show network name in exception message

GabrielBrascher commented on a change in pull request #4396:
URL: https://github.com/apache/cloudstack/pull/4396#discussion_r503293633



##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -3821,7 +3821,7 @@ private void checkIfHostNameUniqueInNtwkDomain(String hostName, List<? extends N
                 // * verify that there are no duplicates
                 if (hostNames.contains(hostName)) {
                     throw new InvalidParameterValueException("The vm with hostName " + hostName + " already exists in the network domain: " + ntwkDomain.getKey() + "; network="
-                            + _networkModel.getNetwork(ntwkId));
+                            + _networkModel.getNetwork(ntwkId).getName());

Review comment:
       I see no problem in adding an *if* checking for a non-null name. However, a network can only be created with a name.
   
   If the network is a non-null Object then I don't see how the name would be null. Unless manual queries have been executed on DB (messing with networks) or there are some bugs on the network removal/update process.




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

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