BryanMLima commented on code in PR #7378:
URL: https://github.com/apache/cloudstack/pull/7378#discussion_r1199225722


##########
server/src/main/java/com/cloud/network/IpAddressManagerImpl.java:
##########
@@ -971,6 +988,13 @@ public List<IPAddressVO> doInTransaction(TransactionStatus 
status) throws Insuff
 
                 if (lockOneRow) {
                     assert (addrs.size() == 1) : "Return size is incorrect: " 
+ addrs.size();
+                    IpAddress ipAddress = addrs.get(0);
+                    boolean ipCanBeAllocated = 
checkIfPublicIpAddressIsNotInQuarantineAndCanBeAllocated(ipAddress, owner);
+
+                    if (!ipCanBeAllocated) {
+                        throw new 
InsufficientAddressCapacityException(String.format("Failed to allocate public 
IP address [%s] as it is in quarantine.", ipAddress.getAddress()),
+                                DataCenter.class, dcId);
+                    }

Review Comment:
   Hey @DaanHoogland, most of the time I would agree with this, even though the 
method would only be called once, there are scenarios that would improve code 
legibility. However,  in this case, I think the code is already clear.



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