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 2021/06/25 19:42:57 UTC

[GitHub] [cloudstack] GabrielBrascher commented on a change in pull request #4714: Cleaning up code and enhancing a few IP management logs

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



##########
File path: server/src/main/java/com/cloud/network/IpAddressManagerImpl.java
##########
@@ -1124,15 +1124,18 @@ public boolean applyIpAssociations(Network network, boolean postApplyRules, bool
         return success;
     }
 
+    private String generateErrorMessageForOperationOnDisabledZone(String operation, DataCenter zone) {
+        return String.format("Cannot %s, %s is currently disabled.", operation, zone);
+    }
+
     @DB
     @Override
     public AcquirePodIpCmdResponse allocatePodIp(String zoneId, String podId) throws ConcurrentOperationException, ResourceAllocationException {
 
         DataCenter zone = _entityMgr.findByUuid(DataCenter.class, zoneId);
         Account caller = CallContext.current().getCallingAccount();
         if (Grouping.AllocationState.Disabled == zone.getAllocationState() && !_accountMgr.isRootAdmin(caller.getId())) {
-            ResourceAllocationException ex = new ResourceAllocationException("Cannot perform this operation, " + "Zone is currently disabled" + "zoneId=" + zone.getUuid(),
-                    ResourceType.network);
+            ResourceAllocationException ex = new ResourceAllocationException(generateErrorMessageForOperationOnDisabledZone("allocate Pod IP addresses", zone), ResourceType.network);

Review comment:
       Good observation; updated code breaking line.




-- 
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-unsubscribe@cloudstack.apache.org

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